From: "S. Cowles" <scowles@earthlink.net>
To: zsh-users@sunsite.dk
Subject: parameter type differences?
Date: Sun, 16 May 2004 14:34:06 -0700 [thread overview]
Message-ID: <200405161434.14167.scowles@earthlink.net> (raw)
In-Reply-To: <20040514102510.GF10581@greux.loria.fr>
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
==================================
next prev parent reply other threads:[~2004-05-16 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-14 10:25 Recursive globbing Vincent Lefevre
2004-05-14 10:54 ` Peter Stephenson
2004-05-14 16:10 ` Bart Schaefer
2004-05-14 16:22 ` Peter Stephenson
2004-05-14 16:35 ` Peter Stephenson
2004-05-17 15:06 ` Vincent Lefevre
2004-05-16 21:34 ` S. Cowles [this message]
2004-05-16 22:02 ` parameter type differences? Wayne Davison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200405161434.14167.scowles@earthlink.net \
--to=scowles@earthlink.net \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).