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

Re: About 'test' compatibility



    Hello Bart :)

>> >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 `='
>..."

    Just curiosity: why BASH doesn't fail here too? The 'test'
builtin of the Bourne shell has the '-d' too.

>This should be written as
>	if [ "x$DEFAULT" = "x-d" -a -n "$3" ]; then
>or something similar.

    I'll notify the maintainer. Thanks for your help :)

    Raúl



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