From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4012 invoked from network); 3 Mar 1999 02:25:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 1999 02:25:08 -0000 Received: (qmail 1723 invoked by alias); 3 Mar 1999 02:24:31 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2197 Received: (qmail 1713 invoked from network); 3 Mar 1999 02:24:29 -0000 Date: Tue, 2 Mar 1999 21:23:44 -0500 From: Sweth Chandramouli To: zsh-users@sunsite.auc.dk Subject: Re: funny behaviour of print Message-ID: <19990302212344.A21122@astaroth.nit.gwu.edu> Mail-Followup-To: zsh-users@sunsite.auc.dk References: <19990302192948.A15698@vmunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i 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 / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) *