From owner-freebsd-questions@FreeBSD.ORG Sun Sep 14 07:54:47 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 D61011065676 for ; Sun, 14 Sep 2008 07:54:47 +0000 (UTC) (envelope-from kusanagiyang@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0AB8FC14 for ; Sun, 14 Sep 2008 07:54:47 +0000 (UTC) (envelope-from kusanagiyang@gmail.com) Received: by py-out-1112.google.com with SMTP id p76so1153228pyb.10 for ; Sun, 14 Sep 2008 00:54:47 -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=iOCRtdnxIj6xKdGFeK2MLaUfRI7DyGgY9VeEFw1v2D4=; b=GoY/rVzJkWnKTuFePxxdzHjgt+BfCqKzBnXZnZ53zNpVQFCPu/rFbo9tCk1G18YZ5K vfVfLDEfbXun5Q0V2P3m3PJ6XuEkb9U8FTWsLzG0ivO7hx7kpQvESa6TLAefAa6UrGra IV8BSjPN8Dka7sv755B5wKQvNX/W7eaSZ7jDc= 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=wn05d9PrZhnVEG0V0S+jCYOqali5Vdfy9cfOA6DEhxjujFqb6mGKTZHzVEbCTiEY2G idgxfyXdKKzs8SKBT1zaG5/10fokaBWUxnU1i4nOEIOm0OZX6sV+TgIQIl0Wtk7zoFTe /aDPVC7buu7gQ6wkqAh9l78QV/jL3wTyb2Np4= Received: by 10.65.75.2 with SMTP id c2mr11413062qbl.58.1221378886695; Sun, 14 Sep 2008 00:54:46 -0700 (PDT) Received: by 10.65.147.15 with HTTP; Sun, 14 Sep 2008 00:54:46 -0700 (PDT) Message-ID: Date: Sun, 14 Sep 2008 00:54:46 -0700 From: "Richard Yang" To: "sahil@tandon.net" In-Reply-To: MIME-Version: 1.0 References: <20080914072936.GS234@shepherd> 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:54:47 -0000 Another question, why my $SHELL return csh, but only bash scripts work? i am really really confused... thanks rich 2008/9/14 Richard Yang > please see below > > 2008/9/14 Sahil Tandon > >> Richard Yang 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 >> > > > > -- > > Best Regards > > Richard Yang > richardyang@richardyang.net > kusanagiyang@gmail.com > -- Best Regards Richard Yang richardyang@richardyang.net kusanagiyang@gmail.com