Date:Fri, 2 May 2025 22:56:43 +0300
From:Valery Ushakov
Message-ID:
| "trap -- - HUP" means the disposition for HUP is SIG_DFL,
No it doesn't, it means there's no trap set for SIGHUP. You get the
same for a whole bunch of other signals that the shell manipulates
Date:Fri, 2 May 2025 15:50:31 +0300
From:Valery Ushakov
Message-ID:
| When run under nohup bash prints that SIGHUP is ignored (empty
| string):
|
| $ rm -f nohup.out; nohup bash -c 'trap -p'; cat nohup.out
| sending output to nohup.out
| trap -- ''
On Fri, May 02, 2025 at 15:21:59 +0200, Edgar Fuß wrote:
> A shell must not trap signals that are ignored when the shell is called.
I am aware of that. I don't see what you mean by that comment given
the question and how it's relevant.
"trap -- - HUP" means the disposition for HUP is SIG_DFL, w
A shell must not trap signals that are ignored when the shell is called.
When run under nohup bash prints that SIGHUP is ignored (empty
string):
$ rm -f nohup.out; nohup bash -c 'trap -p'; cat nohup.out
sending output to nohup.out
trap -- '' SIGHUP
But sh prints that SIGHUP has the default disposition:
$ rm -f nohup.out; nohup sh -c 'trap -p'; cat nohup.out