ok, i've got a question...

James Brister brister at decwrl.dec.com
Wed Sep 26 05:50:58 AEST 1990


On 25 Sep 90 18:59:26 GMT, lwall at jpl-devvax.JPL.NASA.GOV (Larry Wall) said:

> In article <42900 at sequent.UUCP> calvin at sequent.UUCP (Calvin Goodrich) writes:
> : ...for the unix.gods out there. i have a file that has a whole mess of
> : null characters in it ('bout 1/2 a meg). is there any way (preferably
> : a shell script) to strip them off?

> Other possibilities:

> 	sed '' <foo >bar

I try to avoid this unless I know there'll be a new line fairly frequently
(which in a file full of nulls is *usually* unlikely). sed (at least my
version or it) has a line length limit that can cause problems here.

> 	perl -pe 's/\0//g' <foo >bar

Of course :-)

James
--
James Brister                                           brister at decwrl.dec.com
DEC Western Software Lab., Palo Alto, CA    {uunet,sun,pyramid}!decwrl!brister



More information about the Comp.unix.shell mailing list