Quote:
Originally Posted by druuna
$dm = "" => should also work.
|
Actually this works only by means of double brackets or by embedding $dm in double quotes:
Code:
$ [[ $dm = "" ]] && echo ok
ok
$ [ "$dm" = "" ] && echo ok
ok
$ [ $dm = "" ] && echo ok
bash: [: =: unary operator expected
$
Another option is:
Code:
$ [ -z $dm ] && echo ok
ok
but I suspect that in this case (without quotes) the test reduces to testing a string [ -z ], that is always true.
Quote:
Beaten by colucix (again...)
|
Just for a bunch of seconds...