Re: yum check-updates script not working correctly

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



Hello Tod,

On Thu, 2011-05-26 at 10:53 -0400, Denniston, Todd A CIV
NAVSURFWARCENDIV Crane wrote:
> The single '=' sign does assignment, a double '==' does string compare.

No, with the spaces around the '=' and the dollar before the variable
name this actually is a test not an assignment. But using double '=' is
more clear, agreed. Try

#!/bin/sh
C="no"
if [ $C = "yes" ]; then
    echo "1: $C"
fi
if [ $C="yes" ]; then
    echo "2: $C"
fi

This will return:
2: no

Bash is very peculiar ;)

Regards,
Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research


_______________________________________________
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