EMBED THIS RECORDING:
<div><script id="playterm-MjAxMS0xMS9zZWR0dHlyZWMtMTMyMTgyMTMyNXw4MHgyNA==" type="text/javascript" src="https://playterm.org/js/?hash=MjAxMS0xMS9zZWR0dHlyZWMtMTMyMTgyMTMyNXw4MHgyNA==" class="size:80x24"></script></div>
I recorded this `Sed, string toolbox for lazy people` shellsession because its great. Its a utility
that parses text and implements a programming language which can apply transformations to such
text.
EXAMPLES
========
sed "s/Lorem/Foobar/g"
sed "s/Lorem/Foobar/g;s/Foobar/ChangedFoobarintoLorem"
sed -i "s/foo/bar/g" somefile.txt
Damian said
more funky regex-stuff @
http://www.commandlinefu.com/commands/matching/sed-regex/c2VkIHJlZ2V4/sort-by-votes
coderofsalvation said
btw. when replacing urls, you will have to escape every '/' with a backslash. So '/' should be
written as '/'.
Hooooowever, sed has an facility to accept '|' delimiters as well. So for replacing urls, suggested
is:
cat foo.txt | sed 's|http://foo.com|http://bar.com|g'