🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1040

Re: Breaking large file into pieces

#1040
From: Larry Wall
Date: Tue, 11 Sep 1990 23:53
38 lines
2501 bytes
In article <23529:Sep1122:52:3790@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
: In article <9469@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
: > In article <22842:Sep1121:10:3390@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
: > : In article <9466@jpl-devvax.JPL.NASA.GOV> lwall@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
Technical Details
Message-ID: <9472@jpl-devvax.JPL.NASA.GOV>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall
References: <9466@jpl-devvax.JPL.NASA.GOV> <22842:Sep1121:10:3390@kramden.acf.nyu.edu> <9469@jpl-devvax.JPL.NASA.GOV> <23529:Sep1122:52:3790@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall
From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.unix.shell
Subject: Re: Breaking large file into pieces
Message-ID: <9472@jpl-devvax.JPL.NASA.GOV>
Date: 11 Sep 90 23:53:43 GMT
References: <9466@jpl-devvax.JPL.NASA.GOV> <22842:Sep1121:10:3390@kramden.acf.nyu.edu> <9469@jpl-devvax.JPL.NASA.GOV> <23529:Sep1122:52:3790@kramden.acf.nyu.edu>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Organization: Jet Propulsion Laboratory, Pasadena, CA
Lines: 38