[svlug] edit a 1GB file

Rufoo rufoo2001 at yahoo.com
Mon Mar 31 10:06:26 PST 2003

--- William R Ward <bill at wards.net> wrote:

> >> 
> >> perl -pi -e 's/^some line$/some other line/g'
> >> 
> >> "man perlrun" for more.
> >
> >Why even perl when sed can do the same. 
> How?  To the best of my knowledge, the equivalent in
> sed would require
> adding a redirect and a "mv" command.  That's not
> just sed, that's
> sed, shell, and mv.  Perl lets you do it in one
> command.

Yeah, thats right. How does Perl do it?

C:\WINDOWS\Desktop>perl --help > x.txt
C:\WINDOWS\Desktop>perl -pi -e 's/record/hello/g'
Can't do inplace edit without backup.

I am not good at perl, I havent read perlrun yet. but
does it really do inplace edit? How is the inplace
edit implemented? Let me think ... 

Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

More information about the svlug mailing list