bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Null character in replacement


From: Zachary Vance
Subject: Re: Null character in replacement
Date: Fri, 24 Oct 2014 21:02:23 -0700

Andreas: That's extremely helpful to learn. Thanks.

On 24 October 2014 06:13, Andreas Schwab <address@hidden> wrote:

> Zachary Vance <address@hidden> writes:
>
> > sed -e "s/^$/\0/" (in bash, an s// expression containing a literal zero
> > byte) performs no replacements on the stream.
>
> A command line argument cannot contain a literal zero byte, since
> argument strings are zero-terminated, and you would get an error about
> an unterminated command.
>
> $ sed -e $'s/^$/\0/'
> sed: -e expression #1, char 5: unterminated `s' command
>
> Andreas.
>
> --
> Andreas Schwab, address@hidden
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]