Breaking large file into pieces

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Wed Sep 12 09:53:43 AEST 1990


In article <23529:Sep1122:52:3790 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
: In article <9469 at jpl-devvax.JPL.NASA.GOV> lwall at jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
: > In article <22842:Sep1121:10:3390 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
: > : In article <9466 at jpl-devvax.JPL.NASA.GOV> lwall at jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
: > : >     echo "$line"
: > : C'mon, Larry. You know that should be echo -n "$line$n" where $n has
: > : been initialized to a newline. Or echo -n "$line"; echo.
: > Don't teach your grandmother to suck eggs.  Let's see you come up with
: > a solution that also works on all the \c machines.
: > Apart from "Install SVR4".  :-)
: 
: Hmph. Just preprocess the file with sed 's-\\-\\\\-g'. Or, if you really
: like backslashes, sed s/\\\\/\\\\\\\\\/g. Or, if you're a masochist, sed
: s/\\(\\\\\\)/\\\\\\1/g? sh -c "sed s/\\\\(\\\\\\\\\\\\)/\\\\\\\\\\\\1/g"?
: There, that's four solutions, apart from ``install BSD''. :-)
: 
: Oh, sorry, sed is heresy for a Perl lord, isn't it? :-)

No, it isn't.  The official Perl Slogan is: There's More Than One Way To Do It.

There are still a few things sed is good for...   :-)

And you'll note that I did mention sed in my original message.

But "hmph", yourself.  You still haven't posted "a solution that ALSO works
on all the \c machines."  Your -n solution doesn't work on a \c machine,
and your \c solution doesn't work on a -n machine.  At least it's symmetrical.

(By the way, what makes you think s/\\\\/\\\\\\\\/ is a solution?  It only
translates \\, not \c.)

Please don't call me a "Perl lord".  I'm merely trying to follow the ancient
wisdom that "he who wants to be the greatest among you must become the
servant of all."

The leader of this particular jihad doesn't believe in holy war.  Pity.

Larry



More information about the Comp.unix.shell mailing list