Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: parameter type differences?



On Sun, May 16, 2004 at 02:34:06PM -0700, S. Cowles wrote:
> The utility od is used to verify the values of the "bref" and "b"
> parameters.  

Except that you used echo to output the value of the variables, and it
interprets escape sequences by default.  If you change all the "echo -n"
calls to "echo -nE", it will show you how the values differ.  Here's the
output of such a modified script:

case 1.
diff
0000000 012
0000001
0000000 134 060 061 062
0000004
case 2.
diff
0000000 012
0000001
0000000 134 156
0000002
case 3.
same
0000000 012
0000001
0000000 012
0000001

To get rid of this discrepancy, put a $ in front of the string literals
you assign to $b, like this:

b=$'\012'

That will put a single character into $b instead of 4.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author