Can someone tell me why I'm getting [unmatched `] error when I try to run this?
#!/bin/csh -f
source ~/.cshrc
#
set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus
#
set count=`$SQLPLUS -s ${DB_LOGIN} << END
select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;
exit;
END`
#
if [$count < 1] then
echo "ERROR: EOD message for PC not found"
endif
#######
If I remove the "set count =" portion and just have the SQLPLUS run, it does retreieve a count. why can't I set that number to my count variable?
hmmm thats because you are entering more than one line inside "`"
set count=`$SQLPLUS -s ${DB_LOGIN} << END\
set head off;\
select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;\
exit;\
END`
So you're saying if I run it all together into one really long line, it should work? I tried that just now and got a "badly placed ()'s error" - something different though! Would you mind posting it the way you feel it should appear in my .csh ? Thank you!!