1

For the longest time, I would run kill -s9 to send SIGKILL to the process, now it seems it doesn't work on Debian Testing,

$ kill -s 9 988224
kill: unknown signal: SIG9
kill: type kill -l for a list of signals

Moreover, it seems as if it's still documented to work,

-<signal>
-s <signal>
--signal <signal>
      Specify the signal to be sent.  The  signal  can  be
      specified  by using name or number.  The behavior of
      signals is explained in signal(7) manual page.

Interesting, kill -9 works. Why did the -s9 usage stop working?

3
  • 1
    You are probably seeing the behaviour of your shell's builtin kill (specifically zsh by the looks of it) – steeldriver Nov 13 '20 at 19:02
  • @steeldriver exactly what was happening – Evan Carroll Nov 13 '20 at 19:22
  • See the POSIX specification to which zsh's kill conforms here. Use kill -s KILL to send SIGKILL, kill -s 9 is not POSIX. kill -9 and kill -KILL are only POSIX+XSI, so not portable either (though zsh supports both). Avoid signal numbers, prefer signal names. – Stéphane Chazelas Nov 13 '20 at 21:07
2

zsh has it's own version kill,

$ /bin/kill -s9 998126

$ kill -s9 998126
kill: unknown signal: SIGS9
kill: type kill -l for a list of signals

It's not compatible with /bin/kill from procps-ng. The zsh builtin offers,

   kill [ -s signal_name | -n signal_number | -sig ] job ...
   kill -l [ sig ... ]

With kill -n 9 as the closest analog. For more information see man zshbuiltins.

2
  • 1
    All POSIX shells have kill builtin since they need to support job specs like kill %1, jobs being internal to the shell, it's not limited to zsh. The kill man page would document the standalone kill utility. For the documentation of zsh's kill, you'd rather use info zsh kill. – Stéphane Chazelas Nov 13 '20 at 21:13
  • @StéphaneChazelas if I was taking a test I would have gotten that right and provided the same answer. Yet, a decade of using bash, and my brain hasn't quite wrapped around the notion of "not everything will be the same." I changed for PowerLevel9k, and besides the nifty prompt and faster start time everything really feels like the same boring shell. – Evan Carroll Nov 13 '20 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.