Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trap problem.
- X-seq: zsh-workers 13825
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Tanaka Akira <akr@xxxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: trap problem.
- Date: Thu, 29 Mar 2001 05:58:23 +0000
- In-reply-to: <hvo8zlpw8eg.fsf@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <hvo8zlpw8eg.fsf@xxxxxxxxxxxxxx>
On Mar 29, 12:39pm, Tanaka Akira wrote:
} Subject: trap problem.
}
} trap doesn't work as follows.
}
} % Src/zsh --version
} zsh 4.0.1-pre-2 (i386-unknown-freebsd4.2)
} % Src/zsh -fc 'trap "echo INT" INT; sleep 60'
} ^C
} %
}
} It should print `INT' but it doesn't.
That's because zsh has been extremely clever and has `exec'd "sleep 60",
so there's no zsh process around any more to execute the trap.
Try: Src/zsh -fc 'trap "echo INT" INT; sleep 60; sleep 1'
and you'll see ...
Perhaps zsh's tests for whether the last command can be `exec'd should
include testing whether there are any user-defined traps in effect?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author