Alexander Steinböck <bts@bts.grml.org>:
> -if [[ $1 == '-force' ]]; then
> +if [ $1 = '-force' ]; then
Nevermind my previous ACK...
[snip]
# foo.sh
[ $1 = -force ] && echo yay || echo nay
[snap]
% ./foo.sh
[: 1: =: unexpected operator
nay
So, NACK.
I'm all for more quoting.
Always quote variables in POSIX scripts unless you *really* know what
you're doing.
Regards, Frank |