Mailinglist Archive: opensuse (1108 mails)

< Previous Next >
Re: [opensuse] Re: Script to quickly kill frozen TeamViewer 13
On 08/26/2018 09:41 PM, Per Jessen wrote:
Andrei Verovski wrote:

On 08/26/2018 09:20 PM, L A Walsh wrote:
kill $(ps aux | grep '[T]eamViewer' | awk '{print $2}')
I've usually seen it installed, but yours would be more
reliable in the general case (depending on who owns the process
'Teamviewer'), but maybe using  "killall"  might
be more convenient?

BTW, did you mean '[tT]eamViewer' ?

Nope

/opt/teamviewer/tv_bin/teamviewerd

is a network daemon which works fine. Thus, we need to kill only GUI

/opt/teamviewer/tv_bin/TeamViewer

So this is correct:

kill -9 $(ps aux | grep '[T]eamViewer' | awk '{print $2}')
Why not just

kill -9 $(ps aux | grep 'TeamViewer' | awk '{print $2}')

I dont understand your brackets around the 'T'. THey don't do anything?

(I would also have proposed Patricks version with pidof, but he beat me
to it :-) ).

Because
ps aux | grep 'TeamViewer'
results in 2 (!!!) output lines, one pid of TeamViwer and 2nd of grep process itself
3083  3.2  1.4 2089736 120180 ?      Sl   23:33   0:00 /opt/teamviewer/tv_bin/TeamViewer
3156  0.0  0.0   8688   924 pts/0    S+   23:33   0:00 grep --color=auto TeamViewer

while
ps aux | grep '[T]eamViewer'
produces single output line
3083  0.3  1.4 2089736 120180 ?      Sl   23:33   0:00 /opt/teamviewer/tv_bin/TeamViewer

without brackets [T] command will not work as expected





--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >