Q: How can I have a shell script call another shell script...

Q: How can I have a shell script call another shell script...

Post by Michael Stra » Wed, 31 Jan 1996 04:00:00



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?

Thanks,

Mike

 
 
 

Q: How can I have a shell script call another shell script...

Post by Bill Marc » Wed, 31 Jan 1996 04:00:00




>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?

child &

--

"I speak very fluent Spanish.  Todo esta' bien, chevrolet!" --Stevie Wonder

 
 
 

Q: How can I have a shell script call another shell script...

Post by Brian S Hile » Wed, 31 Jan 1996 04:00:00


: 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?

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
does.

echo parent here: doing stuff...
nohup child_prog&
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.

-Brian

--
   ,---.     ,---.     ,---.     ,---.     ,---.     ,---.     ,---.  
  /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \  

__,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.__

 
 
 

Q: How can I have a shell script call another shell script...

Post by Eric Mar » Thu, 01 Feb 1996 04:00:00


: 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?

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
things.  eg:

ksh <scriptname>&

If you want to logout and still have the child process continue:

nohup ksh <scriptname>&

: Thanks,

: Mike

--
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

 
 
 

1. handling SIGINT in shell scripts when executing another shell script.

I have a simple shell script foo1.sh that invokes another shell script
foo2.sh, something like below:

#!/bin/sh
SIGINT_handler()
{
  echo "## [$DATE_TIME]  User interrupt ignored,"
  continue
trap SIGINT_handler 2

...
./foo2.sh
...

----------
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.
Regards,
Vikram Shekhar

2. Kingston Technology KNE2102H ethernet adapter

3. Shell script invoking other shell scripts

4. PATCH mm/slab.c against 2.5.15 (was: slab cache broken on spa rc64)

5. Convert Bash shell script to Korn shell script

6. SBLive Platinum+ALSA emu10k1+Debian 2.2 Why wont it compile?

7. Shell Script Help (C-Shell Script)

8. 2.1.15: what's wrong with serial module?

9. How to pass a variable from a shell script to another shell script...

10. Shell script acting as interactive shell - $0 not script name??

11. shell script within shell script (general question)

12. Korn shell debug: scripts call scripts ...

13. Question: Use a Perl Script to Make a Call to a Bourne Shell Script?