Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Korn Shell scripting...needs help!

Status
Not open for further replies.
Oct 22, 2001
215
US
Greetings!
I am trying to execute one korn shell script through crontab, and scheduler. The crontab runs my script okay. The way it is set up is, the script is a korn shell script that basically calls another korn shell script.

When It is run, instead it doing what it is supposed to do on the 2nd script , it just prints the second script and quit.

Here is an example:
Script 1:
#!usr/bun/ksh
echo "Starting 2nd script..."
ksh MyScript.scr

Here is MyScript.scr
#!usr/bun/ksh
cat a b >c
echo "Done"
exit

When MyScript is executed it works okay that is cat a and b and puts in c
but when the script is run from script 1 it just prints the result....
What am I doing wrong?
TIA
 
I assume it's just a typo, but the first line of both scripts should be
#!/usr/bin/ksh

rather than
#!usr/bun/ksh

It's not clear what you mean by "...just prints the second script..." but I suspect a PATH issue. In script1, try using a fully qualified path to call Myscript.scr.
 
Thanks...
Path is fine...what I meant by print is , it just display the script itself in the log , that is:

cat a b >c >log
echo "Done"
exit

but when I run it , it concatinate the both files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top