Hi all -
I am getting rather odd behavior with this tiny piece of code. I'm basically trying to check the result of a sqlplus session with a korn shell script. It does work, however the echo $ret_code not only echos the error message I want but also a listing of the entire current directory as well. While this isn't a huge problem since I'm going to grep the error message out anyway, I'm curious as to why this is happening. If anyone has any input I'd appreciate it. Here is my code:
Code:
## Just a test script
log=/mkdm/src/scripts/trash/table_test.log
ret_code=$(sqlplus -s <<EOF
user/passwd
set heading off
set feedback off
@/mkdm/src/scripts/trash/table_test.sql;
EOF)
echo $ret_code
#if/else to check value of $ret_code here
exit 0