problem killing a process with its pid

2008-09-14 Thread Richard Yang
I have been trying to kill the process by pulling natd.pid
below are 3 typical examples among a couple dozens I tried

kill -9 $(natd.pid)
Illegal variable name

kill -9 '/var/run/natd.pid'
kill: Arguments should be jobs or process id's

cat /var/run/natd.pid | kill -9
(no error returned, but natd process is still up)


could someone help?
thanks.


-- 

Best Regards

Richard Yang
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem killing a process with its pid

2008-09-14 Thread Richard Yang
Thank you :)
actually,
kill -9 $(cat /var/run/natd.pid |cut -d  -f1)
in a script
will work... (4 hours of work for this)


for some reason, 'kill' doesn't think 'cat natd.pid' is a valid pid.
i have to specially cut the first part out to get it straight
i am using csh

i tried your suggestions just now and below are the result

kill -9 `cat /var/run/natd.pid`
kill: Arguments should be jobs or process id's

kill -9 `cat /var/run/natd.pid|cut -d  -f1`
kill: Arguments should be jobs or process id's

what do you think is the reason?
i most certainly flunk my shell... hehe

rich


2008/9/14 Agus [EMAIL PROTECTED]

 2008/9/14 Richard Yang [EMAIL PROTECTED]:
  I have been trying to kill the process by pulling natd.pid
  below are 3 typical examples among a couple dozens I tried
 
  kill -9 $(natd.pid)
  Illegal variable name
 
  kill -9 '/var/run/natd.pid'
  kill: Arguments should be jobs or process id's
 
  cat /var/run/natd.pid | kill -9
  (no error returned, but natd process is still up)
 
 
  could someone help?
  thanks.
 
 
  --
 
  Best Regards
 
  Richard Yang
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
  ___
  freebsd-questions@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/freebsd-questions
  To unsubscribe, send any mail to 
 [EMAIL PROTECTED]
 

 Hi,

 I dont think this ways are correctly form...

 You probably want to kill the PID thats in that file, so the use as a
 variable, has no use...hehe

 kill -9 `cat /var/run/natd.pid`

 Notice the quotes aren simple..they are like an ascent towards the left

 that will probably work

 If not you can also use the xargs command in the last one u put,
 before the kill -9...

 Cheers,
 Brahama




-- 

Best Regards

Richard Yang
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem killing a process with its pid

2008-09-14 Thread Richard Yang
i just found i am on csh
thanks a lot anyway :)

2008/9/14 Yury Michurin [EMAIL PROTECTED]

 Try:
 kill -9 `cat /var/run/natd.pid`

 (works for me on tcsh)

 On Sun, Sep 14, 2008 at 9:33 AM, Richard Yang [EMAIL PROTECTED]wrote:

 I have been trying to kill the process by pulling natd.pid
 below are 3 typical examples among a couple dozens I tried

 kill -9 $(natd.pid)
 Illegal variable name

 kill -9 '/var/run/natd.pid'
 kill: Arguments should be jobs or process id's

 cat /var/run/natd.pid | kill -9
 (no error returned, but natd process is still up)


 could someone help?
 thanks.


 --

 Best Regards

 Richard Yang
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
 [EMAIL PROTECTED]





-- 

Best Regards

Richard Yang
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem killing a process with its pid

2008-09-14 Thread Yury Michurin
[EMAIL PROTECTED]:~ top 
[1] 72002
[EMAIL PROTECTED]:~ echo 72002  test
[1]  + Suspended (tty output)top
[EMAIL PROTECTED]:~ kill -9 `cat ./test`
[1]Killedtop

try tcsh =)

On Sun, Sep 14, 2008 at 10:28 AM, Richard Yang [EMAIL PROTECTED]wrote:

 i just found i am on csh
 thanks a lot anyway :)

 2008/9/14 Yury Michurin [EMAIL PROTECTED]

 Try:
 kill -9 `cat /var/run/natd.pid`

 (works for me on tcsh)

 On Sun, Sep 14, 2008 at 9:33 AM, Richard Yang [EMAIL PROTECTED]wrote:

 I have been trying to kill the process by pulling natd.pid
 below are 3 typical examples among a couple dozens I tried

 kill -9 $(natd.pid)
 Illegal variable name

 kill -9 '/var/run/natd.pid'
 kill: Arguments should be jobs or process id's

 cat /var/run/natd.pid | kill -9
 (no error returned, but natd process is still up)


 could someone help?
 thanks.


 --

 Best Regards

 Richard Yang
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
 [EMAIL PROTECTED]





 --

 Best Regards

 Richard Yang
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem killing a process with its pid

2008-09-14 Thread Sahil Tandon
Richard Yang [EMAIL PROTECTED] wrote:

 I have been trying to kill the process by pulling natd.pid

Is the rc script, which can be used to stop natd, not working?

 below are 3 typical examples among a couple dozens I tried
 
 kill -9 $(natd.pid)
 Illegal variable name
 
 kill -9 '/var/run/natd.pid'
 kill: Arguments should be jobs or process id's
 
 cat /var/run/natd.pid | kill -9
 (no error returned, but natd process is still up)

In bash, you could:

# kill -9 $(cat /var/run/natd.pid)

-- 
Sahil Tandon [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem killing a process with its pid

2008-09-14 Thread Richard Yang
Another question,

why my $SHELL return csh, but only bash scripts work?
i am really really confused...

thanks
rich


2008/9/14 Richard Yang [EMAIL PROTECTED]

 please see below

 2008/9/14 Sahil Tandon [EMAIL PROTECTED]

 Richard Yang [EMAIL PROTECTED] wrote:

  I have been trying to kill the process by pulling natd.pid

 Is the rc script, which can be used to stop natd, not working?

 it is working. i am setting up natd rules, so i want to make sure updated
 rules apply :)


   below are 3 typical examples among a couple dozens I tried
 
  kill -9 $(natd.pid)
  Illegal variable name
 
  kill -9 '/var/run/natd.pid'
  kill: Arguments should be jobs or process id's
 
  cat /var/run/natd.pid | kill -9
  (no error returned, but natd process is still up)

 In bash, you could:

 # kill -9 $(cat /var/run/natd.pid)

 for some reason, i need
 kill -9 $(cat /var/run/natd.pid|cut -d  -f1)
 in a script and run the script to work...

 what is the equivalent, if i want to invoke it in command line under csh?
 thanks a lot





 --
 Sahil Tandon [EMAIL PROTECTED]




 --

 Best Regards

 Richard Yang
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 

Best Regards

Richard Yang
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]