(solved) untrapping CHLD in CHLD

johnbock

Mitglied
Mitglied seit
2 Mrz 2008
Beiträge
310
Punkte für Reaktionen
0
Punkte
0
At the moment I have no access to a avm router with ash...

Can someone tell me if I can untrap CHLD in while a CHLD trap is active?
Code:
trap
trap 'echo in CHLD trap; trap - CHLD; echo uptrapped?' CHLD
cat /dev/null
trap
 
Zuletzt bearbeitet:
See "help trap" in bash.

Unfortunately, ash does not always behave as bash. In fact in solaris 10, /bin/sh /usr/xpg4/bin/sh, ksh and bash all act a little differently in the above context. Although in most cases the man for a shell may generally be referenced to predict the behavior of another; unless one is using csh;)

Now, I would like to know how ash reacts with the above statement...
 
If this helps:
Code:
/ # trap
/ # trap 'echo in CHLD trap; trap - CHLD; echo uptrapped?' CHLD
/ # cat /dev/null
in CHLD trap
uptrapped?
/ # trap
/ #
wengi
 
Thank you!
 
bash seems to have a problem untrapping SIGCHLD in a SIGCHLD trap: already sent a bashbug...

Code:
$ set -o monitor
$ trap
$ trap 'echo before; trap - CHLD; echo after' CHLD
$ trap
trap -- 'echo before; trap - CHLD; echo after' SIGCHLD
$ /bin/true
before
after
$ trap
trap -- 'echo before; trap - CHLD; echo after' SIGCHLD
$ trap - CHLD
$ trap
$
 
Kostenlos!

Statistik des Forums

Themen
248,917
Beiträge
2,305,038
Mitglieder
378,638
Neuestes Mitglied
Patrick89