Hi,
I have a shell script:
if test $# -ne 3
then
echo "Error : Incorrect number of parameters"
echo "Usage : install.sh fist_day_of_the_month user pass"
echo ""
exit 1
fi
#pas 1
sqlplus -s $2/$3 @pas1.sql $1 >> $0.log;
#verificare date nule
user=$2
passdb=$3
get_count () {
sqlplus -s ${user}/${passdb} <<!
set heading off
set feedback off
set pages 0
SELECT COUNT(TI.CUSTOMERID)
FROM MBTIBUSER.TEMP_IB TI, MBTIBUSER.TEMP_MB TM
WHERE TI.CUSTOMERID = TM.CUSTOMERID
AND TI.REGULARFEEFORIB_AC IS NULL
OR TI.INITIALFEEFORIB_AC IS NULL
OR TM.INITIALFEEFORMOBILE_AC IS NULL
OR TM.REGULARFEEFORMOBILE_AC IS NULL
group by 1;
!
}
count=$(get_count)
echo $count
if [ "$count" -gt 0 ]; then
echo "STOP! Nu exista curs valutar pentru ultima zi a lunii de facturat"
sqlplus -s $2/$3 @STOP.sql >> $0.log;
else
echo "OK"
fi
I have the error "integer expression expected" on the line : if [ "$count" -gt 0 ]; then
Do you have any ideeas?
Thank you,
Claudiu