Sunday, May 3, 2009

SED examples

SEDis a Unix utility which parses text files and implements a programming language which can apply textual transformations to such files. It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script), and then outputs the line. Below are some examples on how SED is normally used.

replace a string, save in a new file:

sed -e 's/VMS/Unix/g' file > file.new

delete all lines starting with "Novell":

sed -e '/^Novell/d' file > file.new

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: