Breaking large file into pieces

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Sep 12 08:52:37 AEST 1990


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? :-)

---Dan



More information about the Comp.unix.shell mailing list