From owner-freebsd-questions@FreeBSD.ORG Wed Oct 6 01:02:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 953C216A4CE for ; Wed, 6 Oct 2004 01:02:18 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id D075C43D53 for ; Wed, 6 Oct 2004 01:02:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a203.otenet.gr [212.205.215.203]) i96123Zm017761; Wed, 6 Oct 2004 04:02:04 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i96121HF002528; Wed, 6 Oct 2004 04:02:01 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i96121Li002527; Wed, 6 Oct 2004 04:02:01 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 6 Oct 2004 04:02:01 +0300 From: Giorgos Keramidas To: Brent Bailey Message-ID: <20041006010201.GJ1471@gothmog.gr> References: <1358.65.175.209.179.1096993388.squirrel@new.host.name> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1358.65.175.209.179.1096993388.squirrel@new.host.name> cc: questions@freebsd.org Subject: Re: shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 01:02:18 -0000 On 2004-10-05 12:23, Brent Bailey wrote: > i need to write a for-loop that will read the 1st line in a aliase file > and grep a passwd file for that user...if that user doesnt exsist in the > passwd file go the 2nd line and grep the passwd file for that user ...and > so on > > anyone have any suggestions ? : cat /etc/mail/aliases | \ : while read line ;do : echo $line : done But as someone else suggested Perl is a lot better for this task.