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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subscript EXITs and Terminates Main Script

Status
Not open for further replies.

LeeP1

Programmer
Nov 27, 2003
2
US
Hi Folks,

I'm a relative newby to Unix shell scripts and have a driving script that calls third party sub-scripts. This has been created from a similar process within DOS.

The problem I have is that when the main script calls a subscript (using EXEC) then when the third party script issues it's final statement of EXIT the whole scripting process terminates. I'd much rather that only the sub script terminated and leave the main process intact to continue.

Is there something that I'm missing with EXEC or is another command available?

I'd rather not edit the third party scripts if I can get away without.

TIA,
 
you might consider changing 'exec' to simply calling the 'subscript'.

Post your 'subscript' invokation sequence to get further help.



vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Doh, it's easy when you know how. Seems that I was making life more difficult!

Doh, doh.

Many Thanks

PS: I just replaced 'exec abc.sh' with 'abc.sh'. Sorted.
 
When you run a script, a child process (shell) is created to run the script. exec tells the shell not to create a child process, but run the script in the current shell.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top