Interrupting only one command from a sequence
news at usenet.ins.cwru.edu
news at usenet.ins.cwru.edu
Sat Nov 17 07:51:48 AEST 1990
In article <1990Nov16.180822.1843 at elroy.jpl.nasa.gov> pjs at euclid.jpl.nasa.gov writes:
>I would like to be able to execute an alias that equates
>to a sequence of commands, e.g. "a; b; c; d" so that
>typing ^C while a is executing causes execution to proceed
>to b, instead of terminating the whole sequence. I'd also
>like to revert to the normal behavior upon completing the
>command sequence. Any ideas?
Well, in bash or ksh you could do
alias abcd="a ; b ; c ; d"
Here's what I get with bash.
thor$ abcd
this is a
^Cthis is b
^Cthis is c
^Cthis is d
^Cthor$
Where a, b, c, and d are all links to the same shell script:
echo this is ${0##*/}
sleep 5
Chet
--
Chet Ramey ``I die, Horatio''
Network Services Group, Case Western Reserve University
chet at ins.CWRU.Edu
My opinions are just those, and mine alone.
More information about the Comp.unix.questions
mailing list