Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
parameter type differences?
- X-seq: zsh-users 7458
- From: "S. Cowles" <scowles@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: parameter type differences?
- Date: Sun, 16 May 2004 14:34:06 -0700
- In-reply-to: <20040514102510.GF10581@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: personal
- References: <20040514102510.GF10581@xxxxxxxxxxxxxx>
- Reply-to: scowles@xxxxxxxxxxxxx
I have the following script, with appended output. There are 3 cases tested,
comparing a reference value for parameter "bref" with 3 values of parameter
"b". The utility od is used to verify the values of the "bref" and "b"
parameters.
My question is: why are the values of "b" not equal to "bref" in cases 1 and
2? If the issue is parameter type, is there any way to display the parameter
type for "b"?
Thank you.
================the script=============
#!/bin/zsh
emulate -R zsh
bref='
'
echo "case 1."
b='\012'
[[ ${bref} == ${b} ]] && echo same || echo diff
echo -n "${bref}" | od -b ; echo -n "${b}" | od -b
echo "case 2."
b='\n'
[[ ${bref} == ${b} ]] && echo same || echo diff
echo -n "${bref}" | od -b ; echo -n "${b}" | od -b
echo "case 3."
b='
'
[[ ${bref} == ${b} ]] && echo same || echo diff
echo -n "${bref}" | od -b ; echo -n "${b}" | od -b
exit 0
================the output============
case 1.
diff
0000000 012
0000001
0000000 012
0000001
case 2.
diff
0000000 012
0000001
0000000 012
0000001
case 3.
same
0000000 012
0000001
0000000 012
0000001
==================================
Messages sorted by:
Reverse Date,
Date,
Thread,
Author