Re: kill pidof question

2010-11-26 Thread Wilko Fokken
On Sat, Oct 30, 2010 at 10:27:17AM -0400, Thomas H. George wrote:
 I frequently have to kill iceape - it locks up on some images.
 
 Of course the command pidof iceape-bin will return the pid to standard
 output and I can then use this information to kill the program.
 Certainly it must be possible to combine these steps into a single
 command line but my efforts to do so have all failed.  Would some pro at
 scripting please set me straight?
 
 Tom
 

(from my old scripts, I found these lines:)

- - - - - - - - - - - - - - - - - - 
if [ -z `pidof iceape-bin` ]; then  ## (returned zero)
echo IceApe not running
fi

...

if [ -n `pidof iceape-bin` ]; then  ## (returned non-zero)
echo IceApe is running
fi
- - - - - - - - - - - - - - - - - - 


hope this might improve your control

Wilko

-- 
Wilko Fokken . . . . . . . . . . . . .  De Künst' geiht wiet, say de Boer;
Landschaftspolder 67 . . . . . . . . .  do sach hei 'n Aap.
D-26831 Bunde
 . . . . . . (Arts must have come a long way,
Tel. 04953-9219882 . . . . . . . . said the landlord becaming aware of an ape.)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101126160606.ga3...@fok03.laje.edewe.de



kill pidof question

2010-10-30 Thread Thomas H. George
I frequently have to kill iceape - it locks up on some images.

Of course the command pidof iceape-bin will return the pid to standard
output and I can then use this information to kill the program.
Certainly it must be possible to combine these steps into a single
command line but my efforts to do so have all failed.  Would some pro at
scripting please set me straight?

Tom


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101030142717.ga9...@tomgeorge.info



Re: kill pidof question

2010-10-30 Thread Klistvud

Dne, 30. 10. 2010 16:27:17 je Thomas H. George napisal(a):

I frequently have to kill iceape - it locks up on some images.

Of course the command pidof iceape-bin will return the pid to standard
output and I can then use this information to kill the program.
Certainly it must be possible to combine these steps into a single
command line but my efforts to do so have all failed.  Would some pro  
at

scripting please set me straight?



Would

snip
killall iceape-bin
pins

do, or are your looking for something more specific?

--
Cheerio,

Klistvud  
http://bufferoverflow.tiddlyspot.com
Certifiable Loonix User #481801  Please reply to the list, not to  
me.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1288452816.800...@compax



Re: kill pidof question

2010-10-30 Thread Camaleón
On Sat, 30 Oct 2010 10:27:17 -0400, Thomas H. George wrote:

 I frequently have to kill iceape - it locks up on some images.
 
 Of course the command pidof iceape-bin will return the pid to standard
 output and I can then use this information to kill the program.
 Certainly it must be possible to combine these steps into a single
 command line but my efforts to do so have all failed.  Would some pro at
 scripting please set me straight?

kill `pidof iceape-bin`

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2010.10.30.15.37...@gmail.com



Re: kill pidof question

2010-10-30 Thread Thomas H. George
On Sat, Oct 30, 2010 at 03:37:01PM +, Camaleón wrote:
 On Sat, 30 Oct 2010 10:27:17 -0400, Thomas H. George wrote:
 
  I frequently have to kill iceape - it locks up on some images.
  
  Of course the command pidof iceape-bin will return the pid to standard
  output and I can then use this information to kill the program.
  Certainly it must be possible to combine these steps into a single
  command line but my efforts to do so have all failed.  Would some pro at
  scripting please set me straight?
 
 kill `pidof iceape-bin`
 
 
Thanks, this works.  I had not known the use of backward single quotes.
I'll read up on them.
 -- 
 
 
 -- 
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
 Archive: http://lists.debian.org/pan.2010.10.30.15.37...@gmail.com
 
 


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101030163439.ga10...@tomgeorge.info



Re: kill pidof question

2010-10-30 Thread Bob Proulx
Thomas H. George wrote:
 Camaleón wrote:
  kill `pidof iceape-bin`

 Thanks, this works.  I had not known the use of backward single quotes.
 I'll read up on them.

Better is the newer $(...) way because $(...)'s can be nested.  The
backticks are great for single simple commands.  But if you try to
nest them then the quoting rules become quite hard.

Bob


signature.asc
Description: Digital signature