On Sun, Mar 15, 2009 at 07:21:06AM -0000, t...@accesslab.com wrote: > This command sequence concatenates a text string with a $'\NNN' string > producing an error: > shopt -s extglob; x="hello"$'\179'; echo "${x//+([^[:print:]])/?}" > > EXPECTED RESULT IS -> hello? > > HOWEVER, THE RESULT THAT IS PRODUCED IS -> hello?9
'179' is not a valid octal number. What you're actually doing is putting hello$'\017'9 into the variable, which you can verify by dumping the contents of $x before the substitution.