[Gllug] Simple Bash Script
Anthony Newman
anthony.newman at ossified.net
Mon Jun 2 10:00:36 UTC 2008
Iain Gray wrote:
> if [ "$RESULT == $TRUE" ];
> Isn't BASH silly in that it uses == for string comparison and -eq for integer?
>
> So this line should be written
>
> if [ $RESULT -eq $TRUE ]
Pretty much.
>> LOAD=`uptime | sed -e "s/.*load average: \(.*\...\), \(.*\...\),
>> \(.*\...\)/\1/" -e "s/ //g"`
LOADAVG=$(cut -f1 -d' ' /proc/loadavg)
;)
Ant
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list