From owner-freebsd-questions@FreeBSD.ORG Sun Sep 14 07:27:23 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C51951065674 for ; Sun, 14 Sep 2008 07:27:23 +0000 (UTC) (envelope-from kusanagiyang@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 870198FC21 for ; Sun, 14 Sep 2008 07:27:23 +0000 (UTC) (envelope-from kusanagiyang@gmail.com) Received: by py-out-1112.google.com with SMTP id p76so1150431pyb.10 for ; Sun, 14 Sep 2008 00:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=MBztIAsPC3CubhJFfpDjgSshyIeoP6Ze5T/1rpYYodI=; b=IQHvV/q8VoHKDE7MSjCH+Xflf5Kh++k2g6UH3fUwS4juNHTLlAD7TQ5W7LA+oZJxOn itWlPnsoYnYqlPRDe1Y26SQ+4PPrLvz5mNQKBs8PN2TkGlhcqZ6io9SydDUXcs/gSTpw D5IBCbuextCnlUmukBUkKRjCjV5n0n6YCHy4k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=sxcyuxkvyYawUj4K1khI9WbiAEWlAjHf728T5rFuZXSMAlgeYNBBZRVaPs7jzdTiIr tlxMcRq0vKXvcuhAIYe1cXDYFkpbGaIsXdY7wOyVE3tMJNAW4YfNdMNRNyLfmn1SGFu8 x7xRrFNqUoPYgUn7DtbSOYNlzGz7571JM91Sk= Received: by 10.64.195.20 with SMTP id s20mr11624473qbf.20.1221377242271; Sun, 14 Sep 2008 00:27:22 -0700 (PDT) Received: by 10.65.147.15 with HTTP; Sun, 14 Sep 2008 00:27:22 -0700 (PDT) Message-ID: Date: Sun, 14 Sep 2008 00:27:22 -0700 From: "Richard Yang" To: Agus In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: questions@freebsd.org Subject: Re: problem killing a process with its pid X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 07:27:23 -0000 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 > 2008/9/14 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 > > richardyang@richardyang.net > > kusanagiyang@gmail.com > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > > > > 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 richardyang@richardyang.net kusanagiyang@gmail.com