From: Gabor Egressy <gabor@vmunix.com>
To: zsh-users@sunsite.auc.dk
Subject: Re: funny behaviour of print
Date: Wed, 3 Mar 1999 08:12:09 -0500 [thread overview]
Message-ID: <19990303081209.A20310@vmunix.com> (raw)
In-Reply-To: <19990302212344.A21122@astaroth.nit.gwu.edu>; from Sweth Chandramouli on Tue, Mar 02, 1999 at 09:23:44PM -0500
On Tue, Mar 02, 1999 at 09:23:44PM -0500, Sweth Chandramouli wrote:
# On Tue, Mar 02, 1999 at 07:29:48PM -0500, Gabor Egressy wrote:
# > I get weird behaviour with print. If I print a variable which is
# > something like below, I get a complaint from it.
# >
# > === $ echo $CTAGS
# > --langmap=c:.c.ec.y.l --c-types=cdefgmnstuvx --kind-long=yes
# > === $ print $CTAGS
# > zsh: bad option: -a
# > zsh: exit 1
# > === $ print --------l hello world
# > hello
# > world
# > === $
#
# i don't get the exit 1 running zsh 3.1.5, but otherwise
# i've seen the same behaviour. two things seem odd about it.
# a) echo assumes that if the first "flag" seen isn't
# valid then no flags were intended (and instead interprets the
# "flags" as arguments to be echoed), while print assumes that if
# the first "flag" seen isn't valid then it was passed a list of
# invalid flags, and complains; and
# b) echo does not accept flags after a double-hyphen, whereas
# print does:
# (astaroth/1909)~: echo -e bob
# bob
# (astaroth/1910)~: echo --e bob
# --e bob
# (astaroth/1911)~: print -l bob
# bob
# (astaroth/1912)~: print --l bob
# bob
But if you look, you'll see it accepts any number of dashes. Which I
find rather silly.
# i guess the immediate workaround would be to alias the builtins
# so that flags were explicitly ignored, with something like
# $ alias echo='echo -' ; alias print='print -'
# (if you wanted to set any flags, of course, you would have to
# then do a `builtin print' or `builtin echo'.)
:) a bit of a pain for a solution. Just have to use
print -- $CTAGS
as that works.
I still would like to know if this is a bug or a 'feature'. :>
prev parent reply other threads:[~1999-03-03 13:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-03 0:29 Gabor Egressy
1999-03-03 2:23 ` Sweth Chandramouli
1999-03-03 13:12 ` Gabor Egressy [this message]
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=19990303081209.A20310@vmunix.com \
--to=gabor@vmunix.com \
--cc=zsh-users@sunsite.auc.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).