Why must I enter "\\\0" to create a string "\0" in zsh?
> echo 0
0
> echo
0
slu@dev:~
> echo
slu@dev:~
> echo " "
# <--- What!!?
slu@dev:~
> echo
slu@dev:~
> echo " "
slu@dev:~
> bash
Executing .bashrc
$ echo " "
$ echo " "
$ echo " "
I gotta say, bash's behavior makes a lot more sense to me.
More details:
slu@dev:~
> echo "0" | hexdump -C
00000000 30 0a |0.|
00000002
slu@dev:~
> echo " " | hexdump -C
00000000 00 0a |..|
00000002
slu@dev:~
> echo " " | hexdump -C
00000000 00 0a |..|
00000002
slu@dev:~
> echo " " | hexdump -C
00000000 5c 30 0a | .|
00000003
slu@dev:~
> echo "\0" | hexdump -C
00000000 5c 30 0a | .|
00000003
slu@dev:~
> echo "\ " | hexdump -C
00000000 5c 00 0a |..|
00000003
slu@dev:~
> echo "\ " | hexdump -C
00000000 5c 00 0a |..|
00000003
slu@dev:~
> echo "\ " | hexdump -C
00000000 5c 5c 30 0a | .|
00000004
The biggest issue is that there is no value that produces the desired result