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

Re: [[ ... ]], [ ... ], bash, zsh



On Aug 14,  1:08am, Haakon Riiser wrote:
} Subject: Re: [[ ... ]], [ ... ], bash, zsh
}
}   if [[ $INITIALIZED ]]; then
} 
}   if [[ -n $INITIALIZED ]]; then
} 
} so I just wanted to know why it was decided that -n should not
} be optional.

It's not the case that someone decided that -n should not be optional.

It is the case that someone decided that arbitrary non-empty strings
should not be considered equivalent to the value "true", and that the
empty string should not be considered equivalent to "false".

The zsh [[ ]] is based on ksh, not on bash:

$ [[ $INITIALIZED ]]
ksh: syntax error: `$INITIALIZED' missing expression operator

So "someone" is probably David Korn.



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