sed-streamlined editor

 <  Day Day Up  >  

sed ”streamlined editor

 sed [n] [e script] [f sfilename] [filename ...] 

sed copies the named filename (standard input default) to the standard output, edited according to a script or command. Does not change the original file.

Example A.49.
 1   sed 's/Elizabeth/Lizzy/g' file 2   sed '/Dork/d' file 3   sed -n '15,20p' file 

EXPLANATION

  1. Substitute all occurrences of Elizabeth with Lizzy in file and display on the terminal screen.

  2. Remove all lines containing Dork and print the remaining lines on the screen.

  3. Print only lines 15 through 20.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net