From: Noob on
Arkadiy wrote:

> Xavier Roche wrote:
>
>> printf "\x00"
>> or
>> echo -en "\x00"
>
> I don't think this works -- the null character is interpreted as the
> end of the string :(

??

$ printf 'foo\0bar' | hexdump -C
00000000 66 6f 6f 00 62 61 72 |foo.bar|
00000007

Note the difference when the string is not quoted.

$ printf foo\0bar | hexdump -C
00000000 66 6f 6f 30 62 61 72 |foo0bar|
00000007