Interview Preparation mode beta
Funny Facebook Status Funny Facebook Status
Enter your email address

How do you inject text with sed?

Nice?Vote!

1 Answer

Nice?Vote!
& in the substitution string defines the pattern found in the search string. As an example, here’s us trying to find a word ‘hello’ and replacing it with ‘hello and how are you’:
 echo ‘hello there’ | sed ’s/^hello/& and how are you/’
answered 1 year ago by R (19,530 points)

Related questions