--- Begin Message ---
Hi,
please try the following bash script:
a=x
del="$(echo -e "\\x7f")"
echo "$del${a#x}" | od -ta
echo "$del ${a#x}" | od -ta
echo " $del${a#x}" | od -ta
Using bash 3.2, the output is:
0000000 del nl
0000002
0000000 del sp nl
0000003
0000000 sp del nl
0000003
however with bash 4.1 and bash 4.2.20, the output is only:
0000000 del nl
0000002
0000000 sp nl
0000002
0000000 sp nl
0000002
... so in the second and third line, the delete character magically
disappears. Neither OS nor locale seem to influence this. Using a delete
character directly in the script instead of $del also has no impact,
either.
Feel free to post this to gnu.bash.bug - unfortunately I don't have a spam
protected email address at hand right now.
Thanks for looking at this!
Yours, RĂ¼diger.
The information included in this e-mail and any files transmitted with it is
strictly confidential and may be privileged or otherwise protected from
disclosure. If you are not the intended recipient, please notify the sender
immediately by e-mail and delete this e-mail as well as any attachment from
your system. If you are not the intended recipient you are not authorized to
use and/or copy this message and/or attachment and/or disclose the contents to
any other person.
--- End Message ---