I would like to have my shell script call another shell script and then
finish processing. Can the parent shell finish processing while the
child continues processing?
"I speak very fluent Spanish. Todo esta' bien, chevrolet!" --Stevie Wonder
The default characteristic of process creation and execution in UNIX,
and thus shell scripting, is to execute asynchronously (that is, all at
the same time) and it takes _extra_ code (to be utterly simplistic
here) to _make_ the parent wait (man 2 wait) for the children to exit.
But on to your question: use the character "&" (ampersand) at the
end of a command, to instruct the parent not to wait for the child to
complete before continuing on. If applicable, "nohup" the child so
that it will not terminate if the parent finishes its task before the child
echo parent here: doing stuff...
echo parent here: still doing stuff...
I wonder, is the nature of your question so ostentively simple as this
elementary question would imply? -- as I recognise your submissions to
this newsgroup in the past as being of a degree more sophisticated than
this question would suggest.
,---. ,---. ,---. ,---. ,---. ,---. ,---.
/ _ \ / _ \ / _ \ / _ \ / _ \ / _ \ / _ \
__,' `.___,' `.___,' `.___,' `.___,' `.___,' `.___,' `.__
Assuming you are, for example, calling a ksh script from a tcsh script,
you can place the child process in the backgound while you go on to other
If you want to logout and still have the child process continue:
nohup ksh <scriptname>&
dMMMMMP dMMMMMb dMMMMMP -[T]- WWW: http://www.io.org/~diehl/
dMP dMP dMP dMP -[O]- Sinclair Spectrum Page:
dMP dMMMMMMP dMMMMMP -[C]- http://www.io.org/~diehl/speccy.html
I have a simple shell script foo1.sh that invokes another shell script
foo2.sh, something like below:
echo "## [$DATE_TIME] User interrupt ignored,"
trap SIGINT_handler 2
while executing foo1.sh, if the script receives SIGINT, how do I ignore
the SIGINT in foo2.sh ? somehow foo2.sh does not finish to completion
and is killed after receiving SIGINT. but foo1.sh is still executing.
Is there any way to trap this signal in the child script. ? Please
share your thots and inputs on this topic.