[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Null character in replacement
From: |
Andreas Schwab |
Subject: |
Re: Null character in replacement |
Date: |
Fri, 24 Oct 2014 15:13:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
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."