Hilfe bei Shellscript erbeten
Maximilian Wilhelm
max at rfc2324.org
Thu Apr 17 14:26:20 CEST 2008
Am Thursday, den 17 April hub Maximilian Wilhelm folgendes in die Tasten:
> Am Thursday, den 17 April hub Andre Landwehr folgendes in die Tasten:
>
> > > > num=$(($(ps aux|grep soffice|wc -l) - 1))
>
> > > Und weil in 'grep soffice' ein 'soffice' vorkommt, ziehst Du hinterher
> > > wieder eins ab? Was, wenn die shell noch dabei ist, den grep zu
> > > starten? Dann bekommst Du eins zuwenig dabei heraus...
>
> > > pgrep!
>
> > und wenn schon normales grep, dann gleich ganz richtig:
> > ps aux |grep soffice |grep -v "ps ax" |grep -v "grep" |wc -l
>
> Och komm...
>
> ps -ef | grep soffce | grep -c -v 'ps ax\|grep'
OK, das '-f' nehm ich zurück, dass könnte in die Hose gehen.
Aber man will ja eh pgrep.
Ciao
Max
--
Follow the white penguin.
More information about the Linux
mailing list