Article View: comp.unix.shell
Article #1241Re: ok, i've got a question...
From: James Brister
Date: Tue, 25 Sep 1990 19:50
Date: Tue, 25 Sep 1990 19:50
23 lines
1530 bytes
1530 bytes
On 25 Sep 90 18:59:26 GMT, lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) said:
> In article <42900@sequent.UUCP> calvin@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@decwrl.dec.com
DEC Western Software Lab., Palo Alto, CA {uunet,sun,pyramid}!decwrl!brister
Technical Details
Message-ID:
<BRISTER.90Sep25155058@westworld.decwrl.dec.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!mephisto!udel!haven!decuac!bacchus.pa.dec.com!decwrl!bristerReferences:
<42900@sequent.UUCP> <9651@jpl-devvax.JPL.NASA.GOV>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!mephisto!udel!haven!decuac!bacchus.pa.dec.com!decwrl!brister From: brister@decwrl.dec.com (James Brister) Newsgroups: comp.unix.shell Subject: Re: ok, i've got a question... Message-ID: <BRISTER.90Sep25155058@westworld.decwrl.dec.com> Date: 25 Sep 90 19:50:58 GMT References: <42900@sequent.UUCP> <9651@jpl-devvax.JPL.NASA.GOV> Sender: news@wrl.dec.com (News) Organization: DEC Western Software Lab Lines: 23 In-Reply-To: lwall@jpl-devvax.JPL.NASA.GOV's message of 25 Sep 90 18:59:26 GMT X-Checksum-Snefru: b86f2c08 5a5bb96b 17872830 20ebd750