killmesoftly
killmesoftly copied to clipboard
Partial matching of command line
in one shell do
$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
in another shell
$ ./kmsn SimpleHTTPServer
No process matches given pattern SimpleHTTPServer
while
$ ps aux | grep SimpleHTTPServer
rochacb+ 6270 0.1 0.0 43340 12660 pts/16 S+ 17:16 0:00 python -m SimpleHTTPServer
but it works if I do
$ ./kmsn python -m SimpleHTTPServer
Can't work with partial matching?
hello, the latter works because you're killing python, actually.
The process matching actually happens on the process name AFAIK, not on the parameters.
There's an option in pgrep (-f) that allows matching on the full command line. I might think about exposing it as a parameter.