Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Maildir empty?



In the last episode (Jul 12), Peter Whaite said:
> DervishD <raul@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author