"Johannes Thoma" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED]:~/bash/bash-3.1$ zak=`printf '\x0d\x0a'`
As documented in the man page under "Command Substitution", this
strips off any trailing newlines from the program's output before
assigning the variable's value. So zak contains only a carriage
return here.
> [EMAIL PROTECTED]:~/bash/bash-3.1$ echo $zak | od -t x1
> 0000000 0d 0a
> 0000002
echo adds a newline at the end of its output. Even if zak had a
newline, since it's unquoted, that newline would be removed.
> [EMAIL PROTECTED]:~/bash/bash-3.1$ zak="${zak}karin"
> [EMAIL PROTECTED]:~/bash/bash-3.1$ echo $zak | od -t x1
> 0000000 0d 6b 61 72 69 6e 0a
> 0000007
Again, the newline comes from echo, not from zak.
paul
_______________________________________________
Bug-bash mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-bash