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

Re: About 'test' compatibility



On Tue, 26 Feb 2002, DervishD wrote:

> >Can you give an example of the way this is failing?
>
> 	if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
>
>     Maybe the '-n' following '-a' is confusing zsh?

No, it's the -d in $DEFAULT that's confusing it.  When $DEFAULT is -d, zsh
is treating the above as "if there is a directory named `=' ..."

This should be written as

	if [ "x$DEFAULT" = "x-d" -a -n "$3" ]; then

or something similar.



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