David Kempe wrote:
Phil Scarratt wrote:

Have you tried
if [ $ERRORNUM -ge 1 ]

Note the $ and the lack of quotes. This works for me in a backup script I have...(maybe I should check it first)


#ERRORNUM=0 ERRORNUM=`grepstuff $LOGTMP |totalerrors` echo $STATUS echo $ERRORNUM #if (( ERRORNUM >= 1 )) if [ $ERRORNUM -ge 1 ] #then let STATUS="$STATUS but with errors" then STATUS="$STATUS but with errors" else echo status screwed fi

gives me:
54
: integer expression expected
status screwed

which is what I expected :(
hrmm, maybe I should just learn perl instead :)

dave


OK. I've actually taken a look at my backup script and I've used test instead of []:


if test $ERRORNUM -ge 1; then


fil -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to