Turned this into an if, because for instance my phone seems to have killall and no pkill, but on the other hand a default Debian installation has only pkill, and to get killall, one needs to additionally install psmisc...
pkill uses -x here to match killall's default behavior
-x, --exact
Only match processes whose names (or command line if -f is specified) exactly match the pattern.
Turned this into an if, because for instance my phone seems to have
killall
and nopkill
, but on the other hand a default Debian installation has onlypkill
, and to getkillall
, one needs to additionally installpsmisc
...pkill uses -x here to match killall's default behavior