Article View: es.comp.os.linux.programacion
Article #11755Re: Un script sencillito...
From: skalvin
Date: Sun, 14 Oct 2001 21:21
Date: Sun, 14 Oct 2001 21:21
30 lines
1764 bytes
1764 bytes
En el art�culo <7vrcq9.nv.ln@127.0.0.1>, "David Ram�n Yanes Fari�a"
<david@elisa.kitenet.net> escribi� lo siguiente:
> A ver, por que le veo varios fallos :)
Pos s� que empezamos bien....
> ->PID="`ps -A | grep esd | cut -c 0-5`"
>
> ponle un echo $PID y ver�s que $PID SIEMPRE contiene algo, de echo
> contiene el comando completo, ya que lo escribes con comillas dobles.
Cierto! lo de las comillas dobles, ha sido al final que estaba haciendo
pruebas a la desesperada ;-)
Al final, lo he dejado de esta forma:
PID=`ps -A | grep esd | cut -c 0-5`
if [ $PID ] ; then
# Matamos el proceso
kill -9 $PID
echo ESD, con pid =$PID, matado!
else
echo ESD no esta ejecutandose!
fi
y parece que funciona....
Gracias de nuevo!
aaaaaaagur!
Technical Details
Message-ID:
<9qcvnd$mjek3$1@ID-83805.news.dfncis.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!193-152-162-24.uc.nombres.ttd.ES!not-for-mailReferences:
<9qcmhb$muh0f$1@ID-83805.news.dfncis.de> <7vrcq9.nv.ln@127.0.0.1>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,2978759c87390d88 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-10-14 14:22:55 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!193-152-162-24.uc.nombres.ttd.ES!not-for-mail From: "skalvin" <skalvinANTISPAM@antisocial.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: Un script sencillito... Date: Sun, 14 Oct 2001 23:21:54 +0200 Lines: 30 Message-ID: <9qcvnd$mjek3$1@ID-83805.news.dfncis.de> References: <9qcmhb$muh0f$1@ID-83805.news.dfncis.de> <7vrcq9.nv.ln@127.0.0.1> NNTP-Posting-Host: 193-152-162-24.uc.nombres.ttd.es (193.152.162.24) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1003094574 23706243 193.152.162.24 (16 [83805]) X-Orig-Path: not-for-mail User-Agent: Pan/0.9.7 (Unix)