sed (the stream editor) will do that. Syntax goes something like this:
Left alone like this, the output will go to stdout, so you will need to redirect it as necessary. Also, as you might expect, the input can be piped from another command instead of using an input file.Code:sed 's///' <input file>
Just don't expect all the features that you get with perl! There is a PET on regexps (written by some dodgy ne'erdowell) that gives examples as to what regexps can be used with sed. The PET doesn't mention pattern match variables (remembering stuff matched in parethesis) which you may be used to - these can also be used with sed.


Reply With Quote
Bookmarks