Hi,
I read and worked on a fix reported to ubuntu regarding this issue.
https://bugs.launchpad.net/hundredpapercuts/+bug/1488939

Eventually it came down to bash builtin vs procps verison of kill having
different options.
I proposed a solution making it more similar to the procps verision in a
way I considered not too invasive.

But since I don't know the bash startegy/guidelines regarding compatibility
across various platforms I wanted to submit it here as a request for
comments as well.

No mailer set up yet on this machine, lets hope gmail doesn't hack this
into pieces :-)

Kind Regards,
Christian
From: Christian Ehrhardt <cpael...@gmail.com>

Fixing some confusion of the bash builtin kill not behaving as the procps
kill which one can see in the manpages by adding a -L option mapping to
the already existing code behind -l.

Signed-off-by: Christian Ehrhardt <cpael...@gmail.com>
---

[diffstat]
 builtins/kill.def |    8 ++++----
 doc/bashref.html  |    6 +++---
 doc/bashref.info  |   16 ++++++++--------
 doc/bashref.texi  |   10 +++++-----
 4 files changed, 20 insertions(+), 20 deletions(-)

[diff]
=== modified file 'builtins/kill.def'
--- builtins/kill.def	2014-03-03 22:52:05 +0000
+++ builtins/kill.def	2015-09-30 13:28:20 +0000
@@ -22,7 +22,7 @@
 
 $BUILTIN kill
 $FUNCTION kill_builtin
-$SHORT_DOC kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
+$SHORT_DOC kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l|-L [sigspec]
 Send a signal to a job.
 
 Send the processes identified by PID or JOBSPEC the signal named by
@@ -32,8 +32,8 @@
 Options:
   -s sig	SIG is a signal name
   -n sig	SIG is a signal number
-  -l	list the signal names; if arguments follow `-l' they are
-	assumed to be signal numbers for which names should be listed
+  -l|-L	list the signal names; if arguments follow `-l' they are
+		assumed to be signal numbers for which names should be listed
 
 Kill is a shell builtin for two reasons: it allows job IDs to be used
 instead of process IDs, and allows processes to be killed if the limit
@@ -107,7 +107,7 @@
     {
       word = list->word->word;
 
-      if (ISOPTION (word, 'l'))
+      if (ISOPTION (word, 'l') || ISOPTION (word, 'L'))
 	{
 	  listing++;
 	  list = list->next;

=== modified file 'doc/bashref.html'
--- doc/bashref.html	2014-04-07 22:47:44 +0000
+++ doc/bashref.html	2015-09-30 13:27:40 +0000
@@ -9838,7 +9838,7 @@
 <DT><CODE>kill</CODE>
 <DD><A NAME="IDX321"></A>
 <TABLE><tr><td>&nbsp;</td><td class=example><pre>kill [-s <VAR>sigspec</VAR>] [-n <VAR>signum</VAR>] [-<VAR>sigspec</VAR>] <VAR>jobspec</VAR> or <VAR>pid</VAR>
-kill -l [<VAR>exit_status</VAR>]
+kill -l|-L [<VAR>exit_status</VAR>]
 </pre></td></tr></table><P>
 
 Send a signal specified by <VAR>sigspec</VAR> or <VAR>signum</VAR> to the process
@@ -9847,8 +9847,8 @@
 <CODE>SIGINT</CODE> (with or without the <CODE>SIG</CODE> prefix)
 or a signal number; <VAR>signum</VAR> is a signal number.
 If <VAR>sigspec</VAR> and <VAR>signum</VAR> are not present, <CODE>SIGTERM</CODE> is used.
-The <SAMP>`-l'</SAMP> option lists the signal names.
-If any arguments are supplied when <SAMP>`-l'</SAMP> is given, the names of the
+The <SAMP>`-l'</SAMP> or <SAMP>`-L'</SAMP> options list the signal names.
+If any arguments are supplied when <SAMP>`-l'</SAMP> or <SAMP>`-L'</SAMP> are given, the names of the
 signals corresponding to the arguments are listed, and the return status
 is zero.
 <VAR>exit_status</VAR> is a number specifying a signal number or the exit

=== modified file 'doc/bashref.info'
--- doc/bashref.info	2014-04-07 22:47:44 +0000
+++ doc/bashref.info	2015-09-30 13:27:41 +0000
@@ -6700,20 +6700,20 @@
 
 `kill'
           kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID
-          kill -l [EXIT_STATUS]
+          kill -l|-L [EXIT_STATUS]
 
      Send a signal specified by SIGSPEC or SIGNUM to the process named
      by job specification JOBSPEC or process ID PID.  SIGSPEC is either
      a case-insensitive signal name such as `SIGINT' (with or without
      the `SIG' prefix) or a signal number; SIGNUM is a signal number.
      If SIGSPEC and SIGNUM are not present, `SIGTERM' is used.  The
-     `-l' option lists the signal names.  If any arguments are supplied
-     when `-l' is given, the names of the signals corresponding to the
-     arguments are listed, and the return status is zero.  EXIT_STATUS
-     is a number specifying a signal number or the exit status of a
-     process terminated by a signal.  The return status is zero if at
-     least one signal was successfully sent, or non-zero if an error
-     occurs or an invalid option is encountered.
+     `-l' or `-L' options list the signal names.  If any arguments are
+     supplied when `-l' or `-L' are given, the names of the signals
+     corresponding to the arguments are listed, and the return status
+     is zero.  EXIT_STATUS is a number specifying a signal number or the
+     exit status of a process terminated by a signal.  The return status
+     is zero if at least one signal was successfully sent, or non-zero if
+     an error occurs or an invalid option is encountered.
 
 `wait'
           wait [-n] [JOBSPEC or PID ...]

=== modified file 'doc/bashref.texi'
--- doc/bashref.texi	2014-04-07 22:47:44 +0000
+++ doc/bashref.texi	2015-09-30 13:27:42 +0000
@@ -7596,7 +7596,7 @@
 @btindex kill
 @example
 kill [-s @var{sigspec}] [-n @var{signum}] [-@var{sigspec}] @var{jobspec} or @var{pid}
-kill -l [@var{exit_status}]
+kill -l|-L [@var{exit_status}]
 @end example
 
 Send a signal specified by @var{sigspec} or @var{signum} to the process
@@ -7605,10 +7605,10 @@
 @code{SIGINT} (with or without the @code{SIG} prefix)
 or a signal number; @var{signum} is a signal number.
 If @var{sigspec} and @var{signum} are not present, @code{SIGTERM} is used.
-The @option{-l} option lists the signal names.
-If any arguments are supplied when @option{-l} is given, the names of the
-signals corresponding to the arguments are listed, and the return status
-is zero.
+The @option{-l} or @option{-L} options list the signal names.
+If any arguments are supplied when @option{-l} or @option{-L} are given,
+the names of the signals corresponding to the arguments are listed, and the
+return status is zero.
 @var{exit_status} is a number specifying a signal number or the exit
 status of a process terminated by a signal.
 The return status is zero if at least one signal was successfully sent,

Reply via email to