From owner-freebsd-questions Sun Mar 17 18:52:32 2002 Delivered-To: freebsd-questions@freebsd.org Received: from brea.mc.mpls.visi.com (brea.mc.mpls.visi.com [208.42.156.100]) by hub.freebsd.org (Postfix) with ESMTP id 5159E37B402 for ; Sun, 17 Mar 2002 18:52:30 -0800 (PST) Received: from sheol.localdomain (hawkeyd-fw.dsl.visi.com [208.42.101.193]) by brea.mc.mpls.visi.com (Postfix) with ESMTP id 479962DDBB1; Sun, 17 Mar 2002 20:52:29 -0600 (CST) Received: (from hawkeyd@localhost) by sheol.localdomain (8.11.6/8.11.6) id g2I2qSW22123; Sun, 17 Mar 2002 20:52:28 -0600 (CST) (envelope-from hawkeyd) Date: Sun, 17 Mar 2002 20:52:28 -0600 From: D J Hawkey Jr To: parv_@yahoo.com, freebsd-questions@freebsd.org Subject: [hawkeyd@visi.com: Re: awk - any possibility of using a variable in regex] Message-ID: <20020317205228.A22100@sheol.localdomain> Reply-To: hawkeyd@visi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG My bad to reply to myself, but I remember I *do* have something like this, without the need for perl or awk: ---8<--- #!/bin/sh for i in ico mouseclock pyro xcursor xearth xfishtank xneko xroach; do killall -9 -u $LOGNAME -c $i 2>/dev/null done --->8--- ----- Forwarded message from D J Hawkey Jr ----- #!/bin/sh TMP=/var/tmp/$0.$$ teststop () { [ `ps -aO ruser |egrep $LOGNAME.+$1 | grep -v grep | tee $TMP | wc -l` -eq 1 ] && kill -9 `cat $TMP | awk '{ print $1 }'` rm -f $TMP } teststop startx teststop xinit ----- End forwarded message ----- Dave -- ______________________ ______________________ \__________________ \ D. J. HAWKEY JR. / __________________/ \________________/\ hawkeyd@visi.com /\________________/ http://www.visi.com/~hawkeyd/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message