Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.shell Subject: Re: Breaking large file into pieces Message-ID: <24879:Sep1202:43:4690@kramden.acf.nyu.edu> Date: 12 Sep 90 02:43:46 GMT References: <9469@jpl-devvax.JPL.NASA.GOV> <23529:Sep1122:52:3790@kramden.acf.nyu.edu> <9472@jpl-devvax.JPL.NASA.GOV> Organization: IR Lines: 27 Larry: > Dan: > : Larry: > : > Dan: > : > : Larry: > : > : > echo "$line" [should be echo -n "$line$n" or echo -n "$line"; echo ] [but that fails on \c machines ] [preprocess with sed 's-\\-\\\\-g' or various others ] > 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. Oh, gimme a break. Your suggestion of switching to SVR4 doesn't work on any machine. :-) It's trivial to select between the two scripts with an echo test. There: a perfectly portable sh solution to the problem that started this thread. > (By the way, what makes you think s/\\\\/\\\\\\\\/ is a solution? It only > translates \\, not \c.) Oh dear. Not paying attention to your quoting? sed s/\\\\/\\\\\\\\/ is translated by the shell into sed s/\\/\\\\/, which is translated by sed into s/\/\\/, which is what we want. \c becomes \\c, which is parsed (correctly) as backslash-c. What makes you think this isn't a solution? ---Dan