
What is the purpose of -e in sed command? - Unix & Linux Stack …
Jun 3, 2015 · In your example sed 's/foo/bar/' and sed -e 's/foo/bar/' are equivalent. In both cases s/foo/bar/ is the script that is executed by sed. The second option is more explicit, but that is …
regular expression - Using sed to find and replace complex string ...
Learn how to use sed with regex for complex string replacements in Unix systems.
unix - sed edit file in-place - Stack Overflow
How do I edit a file in a single sed command? Currently, I have to manually stream the edited content into a new file and then rename the new file to the original file name. I tried sed -i, but my
Find and replace with sed in directory and sub directories
I run this command to find and replace all occurrences of 'apple' with 'orange' in all files in root of my site: find ./ -exec sed -i 's/apple/orange/g' {} \\; But it doesn't go through sub directo...
What does \\1 in sed do? - Stack Overflow
Jan 6, 2011 · To be precise, in s/foo/bar/, only foo is a regular expression, and the rest is other sed syntax. Basically, bar is just a string, though some things like & and \1 have a special …
linux - sed with special characters - Stack Overflow
The single quotes around the sed body will prevent the shell from substituting any variables, so the $ on the left-hand side is escaped only to prevent its special regular expression meaning.
linux - "sed" command in bash - Stack Overflow
Oct 21, 2010 · 51 sed is the Stream EDitor. It can do a whole pile of really cool things, but the most common is text replacement. The s,%,$,g part of the command line is the sed command …
How to use variables in a command in sed? - Stack Overflow
How to use variables in a command in sed? Asked 12 years ago Modified 2 years, 3 months ago Viewed 200k times
Boolean OR in sed regex - Stack Overflow
Feb 11, 2013 · sed uses basic regular expressions by default, enabling use of extended regular expressions is implementation dependent, e.g. with BSD sed you use the -E switch, GNU sed …
regex - sed: Can my pattern contain an "is not" character? How do …
Sep 22, 2011 · +1 Right after the "delete every line which does match" sed example line, I would also include a "or operate on every line that does not match" with a simple sed example of …