I have the following ksh script:
Where $DIR is a variable with the absolute path where a.sql and b.sql are.
For some time, I've been running this script daily and it works fine. The intentions is that both SQL*Plus sessions go to the background and execute in parallel, and when they finish I can continue with the following steps of the application.
Since it's not a test version anymore, I scheduled it on the crontab to execute daily. The problem I have now is that it wont pause on "wait" and let the sqlplus sessions finish, but it directly outputs "Done!". In the real app, that "echo Done!" is actually a call to another program to do some processing on a.sql's and b.sql's output. But since it's not waiting for both sql scripts to actually finish, the processing cannot be done.
It works absolutely perfect when I run it myself, wether I do it from the local directory or from the root (as crontab would do it). But when it is executed automatically by the crontab, I't doesn't stop at wait and screws the whole thing up.
Any ideas on what might be happening? Thanks!
Last edited by Franklin52; 09-12-2012 at 03:36 AM..
Reason: Please use code tags for data and code samples
Please post what Operating System and version you are running:
And what version of Oracle you have.
The Korn Shell script as posted should work if it is invoked directly with full path as an executable script.
Please post the relevant line from crontab and a full directory listing of the script.
The "wait" not work if the "sqlplus" lines are actually other scripts which start a new Shell.
Actually I can't imagine how this works unlesss it is preceded by a cd command or the environment script is in the home directory of the owner of the crontab.
Wherever possible use absolute path names in scripts run from cron.
Hi All,
I have a question related to Shell scripting. In my shell script, I have following two commands in sequence:
sed 's/^/grep "^120" /g' $ORIGCHARGEDAMTLIST|sed "s;$;| cut -f$FIELD_NO1 -d '|' | awk '{ sum+=\$1} END {printf (\"%0.2f\\\n\", sum/100)}' >$TEMPFILE
mv $TEMPFILE $ORIGFILE... (3 Replies)
Hi,
I am facing a strange issue,
when i call a script from my while loop in background it doesnt go in background, despite the wait i put below the whil loop it goes forward even before the process put in background is completed.
cat abc.txt | while read -u4 line
do
#if line contains #... (2 Replies)
hello,
i use following command:
md5sum TEST.xml
the output looks like:
900hjidur84hjr938ikv TEST.xml
as you can see, the first part is the md5 code, the second part is the file name, but i only want the first part(md5 code), and save it to a file, how to do that? thanks. (2 Replies)
Can anybody help me with this small script , the script works fine and launches the IE from
c:\documents and settings \test\my documents>ksh prompt
$RunURL1.sh
this scitpt works and launches the ie from ksh , but when i schedule it to run the script then i get the error box saying command:1... (2 Replies)
HI,
I have a strange problem. A shell script that runs fine on solaris. when i ported to linux, it started hanging.
here is the core of the script
CFG_FILE=tab25.cfg
sort -t "!" -k 2 ${CFG_FILE} | egrep -v "^#|^$" | while IFS="!" read a b c
do
#echo "jobs output"
#jobs
#echo "jobs... (13 Replies)
Hi,
I am trying to execute the below in Ksh (telnet)
find ./request.txt -mmin -30
It says
find: bad option -mmin
What i am trying to do is by using find command i am checking wheather the file request.txt is there for 30 minutes or not
Please help (1 Reply)
Did not use 'wait' yet.
How I understand by now the wait works only for child processes, started background.
Is there any other way to watch completion of any, not related process (at least, a process, owned by the same user?)
I need to start a background process, witch will be waiting... (2 Replies)
I have to copy an array to a temp variable and back after doing some functions. I am trying to see if it is possible to do without while loops.My closest try was
set -A temp ${THE_ARRAY}
# restore array after some actions
set -A THE_ARRAY ${temp}
The problem with above is that, the new... (1 Reply)
Hi all
Trying to run my korn shell script, I got no messages after the sftp.
The "finished" msg is not being displayed.
Any ideas?
sftp $argument <<EOF
quit
EOF
echo "finished"
Thanks in advance,
:O) (1 Reply)