Re: printf "%q" and $'...'

2009-11-24 Thread Maarten Billemont
As for NUL out outputting anything in your result, the cause is C-strings. Arguments are C-strings and those are delimited by NUL bytes. Therefore, the NUL byte that you're putting in it is actually marking the end of the string. So the argument ends BEFORE your NUL byte. So it's empty. As

printf "%q" and $'...'

2009-11-24 Thread Antonio Macchi
Hi, I'm using older bash 3.2.39, so please forgiveme if in your newer bash this issue does not arise. 0x00 and 0x0a has no output in printf "%q" $ for i in {0..9} a; do printf "%q\n" "`echo -en \"\x0$i\"`"; done '' $'\001' $'\002' $'\003' $'\004' $'\005' $'\006' $'\a' $'\b' $'\t' '' -