Re: script calling script - early termination
From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 10/04/05
- Next message: Enrique Perez-Terron: "Re: default permissions when scping files"
- Previous message: Michael Tosch: "Re: script calling script - early termination"
- In reply to: EdStevens: "script calling script - early termination"
- Next in thread: EdStevens: "Re: script calling script - early termination"
- Reply: EdStevens: "Re: script calling script - early termination"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 4 Oct 2005 11:02:42 -0400
On 2005-10-04, EdStevens wrote:
> A little advice is needed. I've been searching the newsgroups and my
> own bookshelf, and if I've seen the answer I've not recognized it as
> such. Here's the deal:
>
> Given a script, myscript.sh
>
> #!/bin/sh
> my_subscript_a.sh
> my_subscript_b.sh
>
> Where both my_subscript_a.sh and my_subscript_b.sh look something like
> this:
>
> #!/bin/sh
> #-- do some work --
> exit $status
>
> Independently, both subscripts work as advertised. However, when I
> execute the parent, myscript.sh, only the first sub (my_subscript_a.sh)
> actually executes. I'm pretty sure that the final 'exit' statement in
> the subscript is what is short-circuiting things, but I can't touch
> that, so am looking for something I can do in the parent script when I
> call the subscript..
Why be "pretty sure" when you can be 100% sure, one way or the
other, by testing the scripts with the exit statement commented
out?
Have you checked the return code of the subscript?
Do you have "set -e" in your parent script?
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>
- Next message: Enrique Perez-Terron: "Re: default permissions when scping files"
- Previous message: Michael Tosch: "Re: script calling script - early termination"
- In reply to: EdStevens: "script calling script - early termination"
- Next in thread: EdStevens: "Re: script calling script - early termination"
- Reply: EdStevens: "Re: script calling script - early termination"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|