sed commands
Eliminate comments
bash$ sed -e 's/#.*//' /etc/inetd
The substitute command:
s/re/repl/flags
flags is zero or more of the characters
- g: substitute all matches of re
- n: substitute the nth match
- p: print the pattern buffer after a successful substitution
- w file: If the substitution was made, then write out the result to the named file
- I: GNU extension! match case-insensitive
s/// is not recursive
s/abc/abc/g
This is not a endless loop!
s/otto/o/g
The String "ottotto" will be changed to "otto", not to "o".