[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kill with regex?



On Son, 19 Jan 2003 at 15:40 (+0000), Hugh Saunders wrote:
> ps x gives a list of xine's which i would like to kill
> 
> 1609 ?        S      0:01 xine /dev/hdc
> 1610 ?        S      0:00 xine /dev/hdc
> 1618 ?        S      0:00 xine /dev/hdc
> 1619 ?        S      0:00 xine /dev/hdc
> 1620 ?        S      0:00 xine /dev/hdc
> 
> tried
> kill 16[1234567890]* 

The shell tries to expand this expression - it works only for
filenames. You must use commands that understand regex instead
(grep, sed, awk ...)

> which returned
> bash: kill: 16[1234567890]*: no such pid
> 
> 1) is the regexp correct to match the pids of the processes?
> 2) how do i get kill or bash to realise its an expression?

kill `pidof xine`

Jan



Reply to: