How to interrupt shell functions?
Eric Halil
eric at brolga.cc.uq.oz.au
Fri Jun 21 10:29:44 AEST 1991
I have the following function (for bash1.08.1)
zless() {
for i in $* ; do
zcat $i | less
done
}
What I'd like to be able to do is interrupt the function. When I interrupt I
can only get (not surprisingly) the "zcat | less". And the for loop continues
on it's merry way. I thought putting a "trap 'return' 2" as the first line
might work, but it didn't. Any suggestions?
Thanks,
Eric.
--
Eric Halil |Internet/CSnet: eric at cc.uq.oz.au
Prentice Computer Centre |Bitnet: eric%cc.uq.oz.au at uunet.uu.net
University of Queensland 4072 |UUCP: uunet!munnari!cc.uq.oz!eric
AUSTRALIA -- Phone: +61 7 365 3610 |JANET: eric%cc.uq.oz.au at uk.ac.ukc
More information about the Comp.unix.shell
mailing list