[NTLUG:Discuss] Quickest way to edit file?
MadHat Unspecific
madhat at unspecific.com
Tue Jul 24 12:08:08 CDT 2007
Wayne Walker wrote:
> MadHat beat me to it, but
>
> On Mon, Jul 23, 2007 at 11:19:09AM -0500, MadHat Unspecific wrote:
>> Perl
>>
>> perl -pi -e 's/email\@address\n//' file
> s/^email\@address\n//
> Or you might delete wwalker at gmail.com along with walker at gmail.com
aye..
>
>> Not saying it is easier than vi, but it is a way of doing it in one
>> command without haveing to rename files and such.
>>
>> Details for those who care:
>>
>> perl - the perl command
>> -pi - use the file specified as if it were called in a while loop
>> (see perlrun for details)
> actually, the -p does the above
>
> -i - edit each filename passed on the command line "in place"
> -i.bak - as above but keep the original file by renaming it.
Thanks for the clarification, I got busy.
--
MadHat (at) Unspecific.com, C²ISSP
E786 7B30 7534 DCC2 94D5 91DE E922 0B21 9DDC 3E98
gpg --keyserver wwwkeys.us.pgp.net --recv-keys 9DDC3E98
More information about the Discuss
mailing list