Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix Question
And BTW.. The solution I think you're looking for is:
#!/bin/ksh
(
exec >> sql_script1.log 2>&1
run_sql $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME $SQL_SCRIPT1
message "$? $SQL_SCRIPT1" $STATUS_FILE
) &
(
exec >> sql_script2.log 2>&1
run_sql $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME $SQL_SCRIPT2
message "$? SQL_SCRIPT2" $STATUS_FILE
) &
wait
If you enclose commands within parens, it forks them in a new shell. The exec replaces your redirections so that ALL messages/ errors within the forked process get logged.. even if the message command itself generates output/ errors.
Be sure to nohup this script.. that should cascade to the child processes.
(NOTE: the nohup removal from the run_sql commands themselves)
HTH Shawn
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed May 26 2004 - 16:12:43 CDT
![]() |
![]() |