Re: What shells fail to work if comparing with "" ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10 February 2011 18:56, Dr. David Kirkby <david.kirkby@xxxxxxxxxx> wrote:
> I know its considered bad practice to check for an empty string with
> something like:
>
> if [ "$STR" = "" ] ; then
>
> but what shells do actually break with this, and under what conditions?
>
>
> I was proposing someone change a test like that to
>
> if [ "x$STR" =  ] ; then

Oops, I meant to put

if [ "x$STR" =  x ] ; then

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux