On Thu, Aug 18, 2011 at 11:10:17AM +0100, Stephane CHAZELAS wrote: > >> Please read BashFAQ/006: http://mywiki.wooledge.org/BashFAQ/006 > > "no force in the universe can put NUL bytes into shell strings usefully"
> No, zsh supports NUL bytes in its strings happily. It's even in > the default $IFS. Where NUL bytes can't go, it's in arguments > to commmands, environment variables, filenames... But I can't > see why a shell variable couldn't contain NUL bytes, it's even a > good thing for both those reasons as you can use that character > to safely separate filenames, arguments, env vars... See for > instance the -0 option of many GNU utilities. zsh doesn't count, because it's not compatible with any other shell. Since this is a bash mailing list (or newsgroup), we're concerned with the behavior of bash, and bash can't store NUL bytes in strings. The reason for this is simple enough -- bash uses native C strings for its variables.