zsh-users
 help / color / mirror / code / Atom feed
From: Sweth Chandramouli <sweth@astaroth.nit.gwu.edu>
To: zsh-users@sunsite.auc.dk
Subject: Re: funny behaviour of print
Date: Tue, 2 Mar 1999 21:23:44 -0500	[thread overview]
Message-ID: <19990302212344.A21122@astaroth.nit.gwu.edu> (raw)
In-Reply-To: <19990302192948.A15698@vmunix.com>

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

	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'.)

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@gwu.edu> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>


  reply	other threads:[~1999-03-03  2:25 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 [this message]
1999-03-03 13:12   ` Gabor Egressy

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=19990302212344.A21122@astaroth.nit.gwu.edu \
    --to=sweth@astaroth.nit.gwu.edu \
    --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).