Table of Contents

Sed

sed -n '/^foo/,/^bar/p' /etc/passwd | sed -r '/^(foo|bar)/d' # Print the range of lines between foo and bar w/o foo and bar.
sed -e "s/rzr/RzR/g" < filein.txt >| fileout.txt
sed -e "s/rzr/RzR/g" -i fileinout.txt
echo "    trim   space    " | sed -e "s/^[[ ]]*//g" | sed -e "s/[[ ]]*$//g"
locate -i -r '\.o$'

Using variables :

echo $PATH | sed -e "s|$USER|root|g"

http://www.student.northpark.edu/pemente/sed/sedfaq4.html#s4.30

didiwiki put EOF at botom see as “^@” on Emacs, workaround :

sed -e "s|\x0||g" -i * 

http://www.inrialpes.fr/pop-art/people/girault/Cours/Automates/td3.html

zero or more:

[[:alnum:]]*

one or more :

[[:alnum:]][[:alnum:]]*
u=http://uuner.doslash.org/forfun/sedtris.sed && wget "$u" &&  u=http://sed.sf.net/grabbag/scripts/playsed.sh.txt && wget "$u" && bash playsed.sh.txt sedtris.sed

WTF

MORE

sed.txt · Last modified: 2022/04/16 12:24 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki