zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: hniksic@srce.hr (Hrvoje Niksic)
Cc: zsh-workers@math.gatech.edu, gene@bear.com
Subject: Re: Is this really correct ?
Date: Mon, 10 Jun 1996 20:17:24 +0200 (MET DST)	[thread overview]
Message-ID: <199606101817.UAA06663@bolyai.cs.elte.hu> (raw)
In-Reply-To: <kigbuirlfmz.fsf@jagor.srce.hr> from Hrvoje Niksic at "Jun 10, 96 07:42:44 pm"

> gene@bear.com (gene@bear.com) wrote:
> > 
> > 
> >    Hpux 9.05.
> > 
> > % echo $ZSH_VERSION
> > 2.6-beta20
> > % a="-s"; if [ "$a" = "-s" ] ;  then echo "yeh" ; fi 
> > % 
> > 
> > (if fails)
> 
> If $a is -s, then the test builtin probably tests for whether file '='
> exists and has a size greater than zero :-). This works for me:
> $ echo hi > =
> $ a="-s"; if [ "$a" = "-s" ] ;  then echo "yeh" ; fi
> yeh
> 
> Thus, it may be an sh incompatibility, but not a bug. Unless the shell
> is supposed to count the arguments first, and then use draw the
> conclusions according to the argument values (in which case the middle
> argument would recognized as two-operand =).

POSIX 1003.2 says that if test has three arguments and $2 is a binary
operator then perform the binary test of $1 and $3.  If $1 is `!', negate
the two-argument test of $2 and $3.  Otherwise, produce unspecified
results.

Zsh will be modified according to this (which is more logical than the
present behaviour).

Zoltan



      reply	other threads:[~1996-06-10 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-10 17:21 gene
1996-06-10 17:42 ` Hrvoje Niksic
1996-06-10 18:17   ` Zoltan Hidvegi [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=199606101817.UAA06663@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=gene@bear.com \
    --cc=hniksic@srce.hr \
    --cc=zsh-workers@math.gatech.edu \
    /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).