Hi all...
Please help me with this questions.
I am not good at shell scripting.
1) It seems like there are many ways that we can run the shell scripts.
what is the difference between each one?
i)./shell_script.sh
ii).(space)./ shell_script.sh
iii)sh shell_script.sh
iv).(space)shell_script.sh
is there any difference in executing the shell scripts in the above ways?
**** I am getting strange errors when i am executing the shell scripts *****
2) one of my shell script (very simple one).
It is working sometimes and it is throwing error some times.
The follwoing script works fine when i run it ./shell_script.sh
and it throws error when i run it like .(space)./shell_script.sh.
(error ksh: ./shell_script.sh[9]: here document `EOF' unclosed)
shell script:
export TEST_VAR="HELLO WORLD"
sqlplus username/password@database << EOF > /lhome/xrmadm/bin/test1.log
set serveroutput on size 200000
whenever sqlerror continue
set echo on
exec dbms_output.put_line('$TEST_VAR');
exit;
EOF
The above script is creating a log file like this test.log? (i dont why that ""?"" is coming after running)
3)I have another script which is working
if i run it .(space)./shell_script.sh
Thanks in advance...please help me with the above questions..