zsh-users
 help / Atom feed
* How to print the trapped command for a specific signal
@ 2018-12-03  2:21 Peng Yu
  0 siblings, 0 replies; 1+ messages in thread
From: Peng Yu @ 2018-12-03  2:21 UTC (permalink / raw)
  To: zsh-users

Hi,

I only see the way to print the trapped commands for all signals. Is
there a way to print the trapped command for a specific signal?
Thanks.

$ cat main.sh
#!/usr/bin/env zsh
# vim: set noexpandtab tabstop=2:

set -v
trap "echo 'Hello World!'" EXIT
trap "echo 'Hello World1!'" ZERR
trap
$ ./main.sh
trap "echo 'Hello World!'" EXIT
trap "echo 'Hello World1!'" ZERR
trap
trap -- 'echo '\''Hello World!'\' EXIT
trap -- 'echo '\''Hello World1!'\' ZERR
Hello World!

-- 
Regards,
Peng

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03  2:21 How to print the trapped command for a specific signal Peng Yu

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox