From owner-freebsd-questions Tue May 15 18:58:14 2001 Delivered-To: freebsd-questions@freebsd.org Received: from phoenix.welearn.com.au (unknown [139.130.44.81]) by hub.freebsd.org (Postfix) with ESMTP id E880A37B422 for ; Tue, 15 May 2001 18:58:09 -0700 (PDT) (envelope-from sue@phoenix.welearn.com.au) Received: (from sue@localhost) by phoenix.welearn.com.au (8.11.1/8.11.1) id f4G1vxe84131; Wed, 16 May 2001 11:57:59 +1000 (EST) (envelope-from sue) Date: Wed, 16 May 2001 11:57:58 +1000 From: Sue Blake To: "Don O'Neil" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help w/ Awk Message-ID: <20010516115758.L26110@welearn.com.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from don@whtech.com on Tue, May 15, 2001 at 06:09:34PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, May 15, 2001 at 06:09:34PM -0700, Don O'Neil wrote: > I'm trying to write a simple script to extract the user name, UID and GID of > each user in the /etc/passwd file and I'm not quite sure what I'm doing > wrong here.... here's a code snippet; Why not just use this: awk -F: '{print $1 " " $3 " " $4}' < /etc/passwd Works for me every time. You could use another delimiter in your output instead of " " spaces. -- Regards, -*Sue*- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message