|
2018-07-09
, 10:11
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#152
|
I've been thinking about a one-liner too. Something along the lines of...
(Caveat: not tried yet.)Code:ps aux | grep whogo* | cut -d " " -f 2 | xargs kill -9
ps aux | grep whogo | grep -v grep | grep -v sh | sed -e "s/\s\{1,\}/ /" | cut -d " " -f 2 | xargs kill
sh whogo-kill
./whogo-kill
The Following 3 Users Say Thank You to pichlo For This Useful Post: | ||
|
2018-07-09
, 10:14
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#153
|
The Following 3 Users Say Thank You to pichlo For This Useful Post: | ||
|
2018-07-09
, 13:07
|
Posts: 292 |
Thanked: 294 times |
Joined on Jan 2012
@ Milan, Italy
|
#154
|
The Following 4 Users Say Thank You to Watchmaker For This Useful Post: | ||
|
2018-07-09
, 18:56
|
|
Posts: 764 |
Thanked: 2,888 times |
Joined on Jun 2014
|
#155
|
I had some problems with cut. I could not convince it to use multiple spaces as a single delimiter. So I had to expand the line a bit but it seems to work now:
It is tested and it works (yes, I had to trigger the issue again to test it but that part was easy).Code:ps aux | grep whogo | grep -v grep | grep -v sh | sed -e "s/\s\{1,\}/ /" | cut -d " " -f 2 | xargs kill
What it does:
- ps aux lists the running processes;
- The first grep filters out only those processes with "whogo" anywhere in the command line that started it - be it in the name or arguments;
- The second grep eliminates the grep process itself from the results;
- The third grep is only useful if you use the attached script - it eliminates the grep script itself from the results;
- sed merges multiple spaces into a single space;
- cut splits each line of output into fields, using a space as a delimiter and letting only the second field (the one containing the process ID, or PID) through;
- xargs collects the output (which by now is a few lines, each containing just the PID of a WhoGo process) into an argument list for the kill command.
I am attaching the line as a script. Copy it into /home/nemo, remove the .txt extension (I had to add it to pacify the TMO uploader) and run from the command line like this:
Or add the execute permission and run it like this:Code:sh whogo-kill
Code:./whogo-kill
pkill harbour-whogo-maps
The Following 5 Users Say Thank You to nthn For This Useful Post: | ||
|
2018-07-09
, 19:08
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#156
|
I don't know what the 'invoker' process is responsible for, but going by the name I'm assuming it isn't the one hanging in the background, so in that case I think you've just created a very complicated way of doing:
Code:pkill harbour-whogo-maps
The Following 6 Users Say Thank You to pichlo For This Useful Post: | ||
|
2018-07-15
, 20:39
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#157
|
The Following 8 Users Say Thank You to rinigus For This Useful Post: | ||
|
2018-07-15
, 21:02
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#159
|
The Following 3 Users Say Thank You to rinigus For This Useful Post: | ||
|
2018-07-15
, 21:07
|
Posts: 387 |
Thanked: 707 times |
Joined on May 2015
@ Italy
|
#160
|
The Following 3 Users Say Thank You to claustn For This Useful Post: | ||
https://github.com/otsaloma/whogo-ma...92b6aa005ee8fa