2009-12-11, 06:17(-07), Eric Blake: > > According to Roman Rakus on 12/11/2009 6:08 AM: >> kill builtin incorrectly thinks that -PGID is signal name even if the >> signal name is set by -s or -n option. >> >> [rra...@dhcp-lab-170 ~]$ kill -s TERM -5032 >> bash: kill: 5032: invalid signal specification > > Not necessarily a bug. POSIX requires that portable shell use: > > kill -s TERM -- -5032
I don't think so. -- is only necessary as the first argument as in kill -- -5032. SUSv4: To avoid an ambiguity of an initial negative number argument specifying either a signal number or a process group, POSIX.1-2008 mandates that it is always considered the former by implementations that support the XSI option. It also requires that conforming applications always use the "--" options terminator argument when specifying a process group, unless an option is also specified. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So I'd say it's a bug. Now, pdksh, ash and their derivatives also have that bug (zsh and AT&T ksh are OK), so the advice to use '--' in any case, in practice should be followed. -- Stéphane