zsh-workers
 help / color / mirror / code / Atom feed
* trap problem
@ 1999-03-05 11:32 Thomas Ziehmer
  1999-03-05 11:24 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Ziehmer @ 1999-03-05 11:32 UTC (permalink / raw)
  To: zsh-workers

Hallo, 
with zsh 3.1.5 (the only tested version) on SGI and HP, but not on Linux, AIX 
and Solaris (there it works correct), the following script produces a wrong
output:

#!/usr/local/bin/zsh

function foo { \
echo step 1
ps
echo step 2
{ echo abcdef ; ps ; } | cat -
echo step 3
}

trap " foo ; exit " INT QUIT TERM HUP

{ time sleep 30 </dev/null ; } 2>/dev/null


ziehmer@o2000 [ziehmer]> t < t
^C
step 1
PID TTY     TIME CMD
21263 ttyq27  0:00 zsh-3.1.5 
23753 ttyq27  0:00 ps 
24969 ttyq27  0:00 t 
step 2
abcdef
step 3

The output of the second ps-command is not shown.
Why?

Regards
Thomas Ziehmer


^ permalink raw reply	[flat|nested] 6+ messages in thread
* trap problem.
@ 2001-03-29  3:39 Tanaka Akira
  2001-03-29  5:58 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Tanaka Akira @ 2001-03-29  3:39 UTC (permalink / raw)
  To: zsh-workers

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.

bash, pdksh, ash and ksh93 works as follows.

% bash -fc 'trap "echo INT" INT; sleep 60'     
^CINT
zsh: exit 130   bash -fc 'trap "echo INT" INT; sleep 60'
% 

ksh93 exits with 2 instead of 130, though.
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-30  9:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-05 11:32 trap problem Thomas Ziehmer
1999-03-05 11:24 ` Peter Stephenson
2001-03-29  3:39 Tanaka Akira
2001-03-29  5:58 ` Bart Schaefer
2001-03-30  7:57   ` Tanaka Akira
2001-03-30  9:36   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).