[ale] Exiting multi-block shell scripts
Kenneth W Cochran
kwc at world.std.com
Wed Jun 28 08:55:31 EDT 2000
>Date: Wed, 28 Jun 2000 08:39:07 -0400 (EDT)
>From: Danny Cox <danny at compgen.com>
>cc: Eric.Ayers at mindspring.com, ale at ale.org
>Subject: Re: [ale] Exiting multi-block shell scripts
>
>On Wed, 28 Jun 2000, Kenneth W Cochran wrote:
>> Whoops... Late-night lack of clear question-asking... :) :/
>>
>> I tried "exit." :)
>>
>> What I Want To Do is be able to control-c out of this thing
>> "anywhere." Best I've been able to do so far is that I have to
>> ^C twice. I guess I should also mention that the "do" object(s)
>> are series of commands (more specifically, I'm trying to
>> quickie-ping an address-range...)
>
>Try 'trap'. Syntax is: trap cmd sigs. For your purpose:
>
> trap 'exit 0' 1 2 3 15
^ ^ <--- yessssss, that was it... :)
I'd been trying trap but having trouble with the syntax.
>Then, when/if the script gets a SIGHUP, SIGINT, SIGQUIT or
>SIGTERM, it will execute the 'exit 0'. There is also a psuedo
>signal #0, which means 'on exit'. I've used this feature many
>times to remove temporary files on the above signals, and on
>exit. Pretty handy.
Indeed... But "trap 'exit 0' 0" wouldn't stop it...
I guess I'm still trying to grok some of the picky syntax-stuff... :)
>Danny
Hey, thanks...
-kc
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list