Skip to contentSkip to conversation

0 and EXIT both work for exit traps.

PATCH In review Adam Buchbinder 3 participants 7 messages Jun 11, 2014 – Sep 26, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 0 and EXIT both work for exit traps.

I saw a discussion in which there was some confusion over whether or not you can use a symbolic name, since the manpage doesn't specifically say so.

---
 ChangeLog  | 4 ++++
 src/dash.1 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
ChangeLog +4 -0
index 2a39e34..81df8d1 100644
@@ -1,3 +1,7 @@
+2014-06-11  Adam Buchbinder <[email protected]>
+
+	* Clarify that 0 and EXIT are both acceptable for exit traps.	
+
 2013-08-23  Herbert Xu <[email protected]>
 
 	* Propagate EXP_QPAT in subevalvar.
src/dash.1 +3 -1
index 6241a61..a07a52d 100644
@@ -2071,7 +2071,9 @@ The signals are specified by signal number or as the name of the signal.
 If
 .Ar signal
 is
-.Li 0 ,
+.Li 0
+or
+.Li EXIT ,
 the action is executed when the shell exits.
 .Ar action
 may be null, which cause the specified signals to be ignored.
Signature · 1 line
2.0.0.526.g5318336
#1 lore raw

PATCH 2/2 Clarify "trap '' signals" syntax in man page

From: Jonathan Nieder <[email protected]>

When the manpage states

| <action> may be null, which cause the specified signals to be ignored.

it is not immediately obvious what it means for an action to be null. Clarify by explicitly referring to an empty string, as opposed to a NULL pointer or the string "null".

---
 ChangeLog | 4 ++++
 1 file changed, 4 insertions(+)
ChangeLog +4 -0
index 81df8d1..5559a24 100644
@@ -1,3 +1,7 @@
+2014-06-11  Jonathan Nieder  <[email protected]>
+
+	* Clarify "trap '' signals" syntax in manual page.
+
 2014-06-11  Adam Buchbinder <[email protected]>
 
 	* Clarify that 0 and EXIT are both acceptable for exit traps.	
Signature · 1 line
2.0.0.526.g5318336
#3 lore raw
Quoted 9 lines · Jonathan Nieder
Quoted 5 lines · Adam Buchbinder
---
 ChangeLog  | 4 ++++
 src/dash.1 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Mph, on second thought this still seems to have a trailing tab for some reason. Patch 2 seems to be missing the change to src/dash.1. Here are the same patches again with that fixed.

Thanks,

Adam Buchbinder (1):
[MAN] 0 and EXIT both work for exit traps.

Jonathan Nieder (1):
[MAN] Clarify "trap '' signals" syntax in manual page

 ChangeLog  | 4 ++++
 src/dash.1 | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
#4 lore raw

PATCH 1/2 0 and EXIT both work for exit traps.

From: Adam Buchbinder <[email protected]>

I saw a discussion in which there was some confusion over whether or not you can use a symbolic name, since the manpage doesn't specifically say so.

---
 ChangeLog  | 4 ++++
 src/dash.1 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
ChangeLog +4 -0
index 2a39e34..3f59ac2 100644
@@ -1,3 +1,7 @@
+2014-06-11  Adam Buchbinder <[email protected]>
+
+	* Clarify that 0 and EXIT are both acceptable for exit traps.
+
 2013-08-23  Herbert Xu <[email protected]>
 
 	* Propagate EXP_QPAT in subevalvar.
src/dash.1 +3 -1
index 6241a61..a07a52d 100644
@@ -2071,7 +2071,9 @@ The signals are specified by signal number or as the name of the signal.
 If
 .Ar signal
 is
-.Li 0 ,
+.Li 0
+or
+.Li EXIT ,
 the action is executed when the shell exits.
 .Ar action
 may be null, which cause the specified signals to be ignored.
Signature · 1 line
2.0.0.526.g5318336
#5 lore raw
Quoted 7 lines · Jonathan Nieder

From: Adam Buchbinder <[email protected]>

I saw a discussion in which there was some confusion over whether or not you can use a symbolic name, since the manpage doesn't specifically say so.

Thanks. Both patches applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#6 lore raw

PATCH 2/2 Clarify "trap '' signals" syntax in manual page

In reply to Jonathan Nieder

When the manpage states

| <action> may be null, which cause the specified signals to be ignored.

it is not immediately obvious what it means for an action to be null. Clarify by explicitly referring to an empty string, as opposed to a NULL pointer or the string "null".

---
 ChangeLog  | 4 ++++
 src/dash.1 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
ChangeLog +4 -0
index 3f59ac2..765b9b6 100644
@@ -1,3 +1,7 @@
+2014-06-11  Jonathan Nieder <[email protected]>
+
+	* Clarify "trap '' signals" syntax in manual page.
+
 2014-06-11  Adam Buchbinder <[email protected]>
 
 	* Clarify that 0 and EXIT are both acceptable for exit traps.
src/dash.1 +3 -1
index a07a52d..68bd5fe 100644
@@ -2076,7 +2076,9 @@ or
 .Li EXIT ,
 the action is executed when the shell exits.
 .Ar action
-may be null, which cause the specified signals to be ignored.
+may be empty
+.Li ( "''" ) ,
+which causes the specified signals to be ignored.
 With
 .Ar action
 omitted or set to `-' the specified signals are set to their default action.
Signature · 1 line
2.0.0.526.g5318336