zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@allantgroup.com>
To: Peter Whaite <peta@whaite.ca>
Cc: ZSH User List <zsh-users@sunsite.dk>
Subject: Re: Maildir empty?
Date: Tue, 13 Jul 2004 13:28:27 -0500	[thread overview]
Message-ID: <20040713182827.GA8522@dan.emsphone.com> (raw)
In-Reply-To: <200407121804.i6CI4W3j005637@brains.moreideas.ca>

In the last episode (Jul 12), Peter Whaite said:
> DervishD <raul@pleyades.net> wrote:
> > > I can only give a partial answer. `[' is treated like any other
> > > command, so its arguments are subject to filename expansion.
> 
> It used to be that /bin/[ was a link to /bin/test,  which is why
> /bin/test still swallows a trailing ].  Now wasn't that clever!

Getting off-topic :)  but if your test eats a trailing bracket it's a
bug.  When test and [ are hardlinked, the program must check argv[0]
and only eat a right-bracket if it was run as [.

$ ls -la =test =\[
814 -r-xr-xr-x  2 root  wheel  93948 Nov 26  2003 /bin/[
814 -r-xr-xr-x  2 root  wheel  93948 Nov 26  2003 /bin/test
$ command test "]" ; echo $?
0
$ command "[" "]" ; echo $?
1


  SYNOPSIS
     test expression
     [ expression ]

     The test utility evaluates the expression and, if it evaluates to
     true, returns a zero (true) exit status; otherwise it returns 1
     (false).  If there is no expression, test also returns 1 (false).
  ...
     The following primaries are used to construct expression:
  ...
     _string_        True if _string_ is not the null string.

-- 
	Dan Nelson
	dnelson@allantgroup.com


  reply	other threads:[~2004-07-13 19:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-12  7:37 Klaus Wacker
2004-07-12  9:43 ` DervishD
2004-07-12  9:44 ` Oliver Kiddle
2004-07-12 12:41   ` Klaus Wacker
2004-07-12 13:22     ` DervishD
2004-07-12 14:09       ` Klaus Wacker
2004-07-12 14:33         ` DervishD
2004-07-12 18:04           ` Peter Whaite
2004-07-13 18:28             ` Dan Nelson [this message]
2004-07-12 10:00 ` Peter Stephenson
2004-07-12 14:17   ` Klaus Wacker
2004-07-12 14:44     ` Peter Stephenson

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=20040713182827.GA8522@dan.emsphone.com \
    --to=dnelson@allantgroup.com \
    --cc=peta@whaite.ca \
    --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).