From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 16:05:36 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 335601065694 for ; Mon, 1 Feb 2010 16:05:36 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id BB0D48FC1A for ; Mon, 1 Feb 2010 16:05:35 +0000 (UTC) Received: by bwz5 with SMTP id 5so1477670bwz.3 for ; Mon, 01 Feb 2010 08:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=T4HVYHHY/EJGUgidrf68nIxcjHD7qcQjIAqvgNVpFGc=; b=bIHMpe7pPOBiyeph18LWHQHQnmK82Qvfiai7EIgVMOizyEpkgXjqSp0BYFxZg8PE9G 5Mwxy680/rmw5NDk2Gk3LBMBl49DEt/I15bjR8Y7RFSh3h4zZbv9FIeBWckBaQH5t+Pa sRYSbh6snnk+t0pE/4vPsNmOuPH5SgOw+r8CA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=DQo2OKFl41CvNLnudSu8KgVbp6rVotwR/JCNUUXi83QGSSc2x/eDkfdITWW/F1rc2m xMzi0dD9a35h5dkvbluHcebBuoZuFJDTyr5BnhshiivIGDyHJJRHk1mIeE/uthx9zhdb ohdHn3EVRl5dEnsv3MReBeJGxONBNHUkG5tRQ= MIME-Version: 1.0 Received: by 10.239.192.79 with SMTP id d15mr635774hbi.52.1265039034316; Mon, 01 Feb 2010 07:43:54 -0800 (PST) From: Eitan Adler Date: Mon, 1 Feb 2010 17:43:32 +0200 Message-ID: To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: [patch] pkill verbose option X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 16:05:36 -0000 Here is a patch that adds a -V option which prints out what PIDs it is taking action on. Index: pkill.c =================================================================== --- pkill.c (revision 203347) +++ pkill.c (working copy) @@ -105,6 +105,7 @@ static int oldest; static int interactive; static int inverse; +static int flagPrint = 0; static int longfmt; static int matchargs; static int fullmatch; @@ -182,7 +183,7 @@ pidfilelock = 0; execf = coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:Vad:fg:ij:lnos:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -272,6 +273,9 @@ case 'v': inverse = 1; break; + case 'V': + flagPrint = 1; + break; case 'x': fullmatch = 1; break; @@ -532,6 +536,10 @@ if (PSKIP(kp)) continue; if (selected[i]) { + if (flagPrint) + { + printf("%d\n",kp->ki_pid); + } if (inverse) continue; } else if (!inverse)