awk script

SHETAL NATAWARBH PATEL snpatel at ncsuvx.enet.dec.com
Wed Mar 20 09:38:02 AEST 1991


> 
> CMD='dxclock'
> ME=`whoami`
> PROC=`ps -ef | grep /${CMD}|
> awk '$1 == '${ME}' && $8 != "grep" {print $2}'`
> kill -HUP ${PROC}
>
 I tried this script and it doesn't work.
 But I finally got this to work,

   CMD='dxclock'
    ME=`whoami`
  PROC=`ps -aux | grep ${CMD}|grep -v grep| \
        awk '{print $2}'`
  kill -9 ${PROC}

Is there any way to ask the user to type in the command that they wish to kill
and then kill it after the entry?

--
Nothing more smooth than glass, yet nothing more brittle;
Nothing more fine than wit, yet nothing more fickle.
      -=> Thomas Fuller, Gnomologia No. 6472 <=-
+-----------------------------------------------------------------+
|  Shetal N. Patel                                                |
|  snpatel at eos.ncsu.edu          NORTH CAROLINA STATE UNIVERSITY  |
+-----------------------------------------------------------------+



More information about the Comp.unix.questions mailing list