Re: yum check-updates script not working correctly

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



On 5/26/2011 11:22 AM, Leonard den Ottolander wrote:
>
> if [ $C="yes" ]; then
>      echo "2: $C"
> fi
>
> This will return:
> 2: no
>
> Bash is very peculiar ;)

No, it should tokenize this into fields, breaking on the elements in 
$IFS (normally white space).  So you end up with one field and according 
to 'man test', STRING is equivalent to -n STRING.  If you want it to 
tokenize into more fields so the test sees 2 strings and and operator, 
you have some white space there.

-- 
   Les Mikesell
    lesmikesell@xxxxxxxxx
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux