Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Nov 2017 13:01:12 -0500
From:      "James B. Byrne" <byrnejb@harte-lyne.ca>
To:        "Yuri Pankov" <yuripv@gmx.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: sed - remove nul lines from file
Message-ID:  <c2b1ffce6933bcb8f47c856a40d29b16.squirrel@webmail.harte-lyne.ca>
In-Reply-To: <88a59a82-2902-9f63-0a94-bd23b910e7ad@gmx.com>
References:  <b21bf201363c34a90ab55c4a05ff8fd7.squirrel@webmail.harte-lyne.ca> <88a59a82-2902-9f63-0a94-bd23b910e7ad@gmx.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, November 7, 2017 12:36, Yuri Pankov wrote:
>
> Apparently, our regex engine doesn't accept the '\x' syntax, try a bit
> more complicated, but standard way :-)
>
> sed '/[[.NUL.]]/d'
>

sed /[[.NUL.]]/g INFILE > OUTFILE

gives the same result as

tr < INFILE -d '\000' > OUTFILE

sed /^[[.NUL.]]$/g INFILE > OUTFILE  has no effect whatsoever.  No
doubt because I am not specifying the record delimiters appropriately.


-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c2b1ffce6933bcb8f47c856a40d29b16.squirrel>