in reply to Is this possible to make a one liner?
Well, assuming the asker wants an answer written in Perl (this isn't unixmonks.org or shellscriptmonks.org) I'll give it a shot. The given code and the description don't seem to match. A one liner for the ACTUAL CODE GIVEN (i.e. will remove every occurance of } in the file):
perl -i.old -pe 's/}//g;' memgrp.dat
If you just want to remove } when it occurs at the end of the line, just change the regexp to something like s/}(\s*)$/$1/gThis code has been lightly tested and "it works for me."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Is this possible to make a one liner?
by Grygonos (Chaplain) on Aug 02, 2003 at 06:53 UTC |