I'm confused about the matching with case. When i start the start.sh, the RS Variable is filled with "1". But is not recognized by the case statement. I allways run into the "no match" clause. If i fill "RS" manually with "1" (RS=1) then it works fine. Does someone know the rreason why?
thx in advance
Uwe
Note: the "1" in the Log-File is my Test-Output (... echo $RS >> mytest.log)
=====================================
# start.sh:
RS=`$SQL_PLUS -silent user/passwd @../sql/dwh_start.sql`
echo " Start :" $RS >> ../log/dwh_start.log
echo $RS >> mytest.log
case $RS in
1) echo 'wert nr 1' >> mytest.log ;;
'1') echo 'wert nr 1a' >> mytest.lo ;;
"1") echo 'wert nr 1b' >> mytest.log ;;
*) echo 'no match' >> mytest.log ;;
esac
=====================================
-- dwh_start.sql:
SET HEAD OFF
SET TERMOUT ON
SET SERVEROUTPUT OFF
SET DEFINE ON
SET FEEDBACK OFF
SET VERIFY OFF
select aktiv from T_SYS_ABLAUFST
where to_char(datum, 'dd.mm.rrrr') = to_char(sysdate,'dd.mm.rrrr');
quit;
===================================
-- mytest.log:
1
no match
====================================