Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
-- Éric Lévénez -- <http://www.levenez.com/> Unix is not only an OS, it's a way of life.
Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est
juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire
la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
--
Éric Lévénez -- <http://www.levenez.com/>
Unix is not only an OS, it's a way of life.
Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
-- Éric Lévénez -- <http://www.levenez.com/> Unix is not only an OS, it's a way of life.
patpro ~ patrick proniewski
In article <4e6c83ff$0$14975$, Éric Lévénez wrote:
Le 11/09/11 11:06, Michael a écrit : >> PID=$( ps -ax | grep Finder | grep -v grep | awk '{print $1}' ) > > Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
en même temps...
ps -axc | awk '/Finder/ {print $1}'
mais bon, pourquoi le Finder alors qu'on cherche Remote Desktop ? :)
patpro
-- A vendre : KVM IP 16 ports APC http://patpro.net/blog/index.php/2008/01/12/133
In article <4e6c83ff$0$14975$426a34cc@news.free.fr>,
Éric Lévénez <usenet@levenez.com> wrote:
Le 11/09/11 11:06, Michael a écrit :
>> PID=$( ps -ax | grep Finder | grep -v grep | awk '{print $1}' )
>
> Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est
juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire
la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
en même temps...
ps -axc | awk '/Finder/ {print $1}'
mais bon, pourquoi le Finder alors qu'on cherche Remote Desktop ? :)
patpro
--
A vendre : KVM IP 16 ports APC
http://patpro.net/blog/index.php/2008/01/12/133
In article <4e6c83ff$0$14975$, Éric Lévénez wrote:
Le 11/09/11 11:06, Michael a écrit : >> PID=$( ps -ax | grep Finder | grep -v grep | awk '{print $1}' ) > > Voilà, c'est cette commande awk qu'il me fallait : man awk :-)
Cette commande traîne sur Internet depuis longtemps. Le grep -v grep est juste parce que l'option -c a été oubliée dans le ps. Bref, pour faire la même chose :
ps -axc | grep -w Finder | awk '{print $1}'
en même temps...
ps -axc | awk '/Finder/ {print $1}'
mais bon, pourquoi le Finder alors qu'on cherche Remote Desktop ? :)
patpro
-- A vendre : KVM IP 16 ports APC http://patpro.net/blog/index.php/2008/01/12/133
Éric Lévénez
Le 11/09/11 11:57, patpro ~ patrick proniewski a écrit :
In article<4e6c83ff$0$14975$, Éric Lévénez wrote:
ps -axc | grep -w Finder | awk '{print $1}'
en même temps...
ps -axc | awk '/Finder/ {print $1}'
Oui, effectivement. Mais de toute façon le killall est préférable dans tous les cas.
mais bon, pourquoi le Finder alors qu'on cherche Remote Desktop ? :)
Ah, ça c'est une autre histoire. :-)
-- Éric Lévénez -- <http://www.levenez.com/> Unix is not only an OS, it's a way of life.
Le 11/09/11 11:57, patpro ~ patrick proniewski a écrit :
In article<4e6c83ff$0$14975$426a34cc@news.free.fr>,
Éric Lévénez<usenet@levenez.com> wrote:
ps -axc | grep -w Finder | awk '{print $1}'
en même temps...
ps -axc | awk '/Finder/ {print $1}'
Oui, effectivement. Mais de toute façon le killall est préférable dans
tous les cas.
mais bon, pourquoi le Finder alors qu'on cherche Remote Desktop ? :)
Ah, ça c'est une autre histoire. :-)
--
Éric Lévénez -- <http://www.levenez.com/>
Unix is not only an OS, it's a way of life.