From owner-freebsd-questions Fri Nov 9 22:43:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ns2.wananchi.com (ns2.wananchi.com [212.49.74.4]) by hub.freebsd.org (Postfix) with ESMTP id 5951A37B41B for ; Fri, 9 Nov 2001 22:43:28 -0800 (PST) Received: from wash by ns2.wananchi.com with local (Exim 3.33 #1) id 162Rqc-00027b-00; Sat, 10 Nov 2001 09:42:34 +0300 Date: Sat, 10 Nov 2001 09:42:34 +0300 From: Odhiambo Washington To: smorton@acm.org Cc: FBSD-Q Subject: Re: Help with AWK Message-ID: <20011110094234.B1578@ns2.wananchi.com> Mail-Followup-To: Odhiambo Washington , smorton@acm.org, FBSD-Q References: <20011109194842.E27386@ns2.wananchi.com> <3BEC628A.5050005@verizon.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <3BEC628A.5050005@verizon.net> User-Agent: Mutt/1.3.23i X-Disclaimer: Any views expressed in this message,where not explicitly attributed otherwise, are mine alone!. X-Fortune: "Nuclear war would really set back cable." -- Ted Turner X-Operating-System: FreeBSD 4.4-STABLE i386 X-Best-Window-Manager: XFCE X-Mailer: Mutt http://www.mutt.org/ X-Designation: Systems Administrator, Wananchi Online Ltd. X-Location: Nairobi, KE, East Africa. X-Uptime: 9:36AM up 17:27, 2 users, load averages: 0.27, 0.20, 0.17 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 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Simon Morton [20011110 02:17]: writing on the = subject 'Re: Help with AWK' | If I understand correctly, the following should do it: |=20 | awk -F: '$4=3D=3D40{printf "^%s@.*\\.wananchi.com$:%s$:%s/:\n",$1,$3,$2;}' |=20 Hello Simon, That is not it ;). That line gives the following: #^user@.*\.wananchi.com3552YZb2gtYJeEZ1Y/: What I want (from master.passwd) are the following fields with the extras ^$1@.*\.wananchi.com$:$3:$2: $1 =3D login id $2 =3D encrypted passwd $3 =3D numerical UID All with colon as the separator. I need to extract those details for two groups of users - staff (GID=3D=3D2= 0) and wheel (GID=3D=3D0), all in one command, if possible. -Wash S y s t e m s A d m i n i s t r a t o r -- ~\\_ =20 Odhiambo Washington \\\\ =20 Wananchi Online Ltd., `\\\\\ =20 1st Flr Loita Hse, Loita Street |\\\\\ =20 PO Box 10286,00100-NAIROBI,KE. \\\\\|__.--~~\ =20 Fax: 254 2 313985-9 _--~ / =20 Fax: 254 2 313922 /~ ////// _-~~~~' =20 E-mail: wash@wananchi.com ('-//////-// =20 URL : http://www.wananchi.com //////(((-) =20 GSM: 254 72 743 223 / 254 733 744 121 /////" =20 _///" =20 +++ Religion has done love a great service by making it a sin. -- Anatole France --gBBFr7Ir9EOA20Yy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE77Mxan7LIsuxjem8RAqV/AKCurPeuYbBg/mrftVty6q+dcCSCBwCghdGa Rqhq/FVD5AjWYVDODjMQqQk= =eTcV -----END PGP SIGNATURE----- --gBBFr7Ir9EOA20Yy-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message