[ale] Exiting multi-block shell scripts

Fletch fletch at phydeaux.org
Wed Jun 28 08:41:00 EDT 2000


>>>>> "Kenneth" == Kenneth W Cochran <kwc at world.std.com> writes:


[...]

    Kenneth> What I Want To Do is be able to control-c out of this
    Kenneth> thing "anywhere." Best I've been able to do so far is
    Kenneth> that I have to ^C twice.  I guess I should also mention
    Kenneth> that the "do" object(s) are series of commands (more
    Kenneth> specifically, I'm trying to quickie-ping an
    Kenneth> address-range...)

        The problem is that the ^C is going to the program that's
running, not to the script.  The script itself is simply resuming
execution once the child process exits.  You could check if the child
exited with a non-zero exit status (which it would if killed by a
signal) with something like:

  if [ $? -ne 0 ] ; then 
    echo "Child killed"
    exit 1
  fi

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
678 443-6239(w)       |  scary questions." -- Jules                =(___)=
                      |                                               U
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list