I have the following script running every day numerous times a day and it works fine, but very occasionally I get the following error
if: Badly formed number.
Anyone know why?
Here is the script that runs with the follow parms
LCTMDBSE 100000 130000 160000
#!/bin/csh
##############################
# Variables and Parameters #
##############################
set JOBNAME=$0
set LOWNUM=$1
set MEDNUM=$2
set HIGHNUM=$3
##############################
# Validate Number of parms #
##############################
if $#argv != 3 then
echo YOU MUST SUPPLY 3 PARAMETRES - LOW, MEDIUM AND HIGH VALUES
exit 1
endif
###################################
# Validate Parms in correct order #
###################################
if ( ( $HIGHNUM <= $MEDNUM ) || ( $HIGHNUM <= $LOWNUM ) || ( $MEDNUM <= $LOWNUM ) ) then
echo YOU MUST SUPPLY 3 PARAMETRES IN ASCENDING ORDER - LOW, MEDIUM AND HIGH VALUES
exit 2
endif
##############################
# Remove full path #
##############################
set PATH_BREAKDOWN=`echo $JOBNAME | tr / " "`
foreach BARREL ( $PATH_BREAKDOWN )
set REALJOBNAME=$BARREL
end
set JOBNAME=$REALJOBNAME
set CMPROFILE=`whoami`
##############################
# Run the SQL #
##############################
set RESULT=`LCTMSQL count_dbase`
###################################
# Compare Results #
###################################
if ( "$RESULT" <= "$LOWNUM" ) then
echo Number of jobs on $CMPROFILE Database is $RESULT
echo This is classed as LOW
exit 0
endif
if ( "$RESULT" >= "$MEDNUM" && "$RESULT" < "$HIGHNUM" ) then
echo Number of jobs on $CMPROFILE Database is $RESULT
echo This is classed as MEDIUM
exit 4
endif
if ( "$RESULT" >= "$HIGHNUM" ) then
echo Number of jobs on $CMPROFILE Database is $RESULT
echo This is classed as HIGH
exit 8
endif