Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: aus9 on September 09, 2016, 05:34:14 PM
-
This is my cheat guide as i not experienced with sed
http://www.theunixschool.com/2014/08/sed-examples-remove-delete-chars-from-line-file.html
to remember what the letters s g etc stand for
http://www.grymoire.com/Unix/Sed.html
-
Pretty much the same but maybe some more involved examples.
http://www.unixguide.net/unix/sedoneliner.shtml
-
I don't doubt there are times when the snail pace SED can resolve some complicated string manipulation easily, however for almost all cases I have found with a little creativity it's more efficient by far to use "Parameter substitution and expansion" already built-in to the shell itself, which is incredibly fast.. I'd recommend mastering this before delving into Sed. Beside, Sed is too slow and consumes a huge amount of resources unnecessarily just to resolve one simple string manipulation.
Check out "Parameter Substitution" under "Advanced Bash-Scripting Guide"
I think Sed is better suited for text manipulation within a document/text file