[CentOS] yum check-updates script not working correctly

Les Mikesell lesmikesell at gmail.com
Thu May 26 17:52:55 UTC 2011


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 at gmail.com



More information about the CentOS mailing list