[svlug] edit a 1GB file
Karsten M. Self
kmself at ix.netcom.com
Mon Mar 31 10:19:59 PST 2003
on Mon, Mar 31, 2003 at 09:38:59AM -0800, William R Ward (bill at wards.net) wrote:
> Rufoo writes:
> >
> >--- Will Lowe <harpo at thebackrow.net> wrote:
> >> together again.
> >>
> >> or perhaps:
> >>
> >> 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.
Perl merely hides these steps from you. The write new and mv old => new
are done behind your back. _The Perl Cookbook_ and/or _Programming
Perl_ describe this process.
Peace.
--
Karsten M. Self <kmself at ix.netcom.com> http://kmself.home.netcom.com/
What Part of "Gestalt" don't you understand?
Moderator, Free Software Law Discussion mailing list:
http://lists.alt.org/mailman/listinfo/fsl-discuss/
More information about the svlug
mailing list