What Does `-E` Option in Sed Do?
I Am Trying to Understand a Shell Script That Uses Sed. I Found That There Were Some Places Where Sed Was Invoked with the -E Option. I Tried to See the Man...
I am trying to understand a shell script that uses sed. I found that there were some places where sed was invoked with the -e option.
I tried to see the man page and it just mentions,
-e command
Append the editing commands specified by the command argument to the list of commands.
which is not very clear to me.
Can someone kindly explain to me what the -e does? Thanks.
PS: I am using sed in mac
1 Answer
The -e parameters tells sed that you wish to supply multiple commands:
sed -e 's/string1/string2/g' -e 's/string4/string5/g'
This will replace string1 with string2 and string4 with string5.