From owner-freebsd-questions Fri Nov 9 13:45:55 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 9FE8137B405 for ; Fri, 9 Nov 2001 13:45:48 -0800 (PST) Received: from wash by ns2.wananchi.com with local (Exim 3.33 #1) id 162Epf-00093e-00 for freebsd-questions@freebsd.org; Fri, 09 Nov 2001 19:48:43 +0300 Date: Fri, 9 Nov 2001 19:48:42 +0300 From: Odhiambo Washington To: FBSD-Q Subject: Help with AWK Message-ID: <20011109194842.E27386@ns2.wananchi.com> Mail-Followup-To: Odhiambo Washington , FBSD-Q Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline User-Agent: Mutt/1.3.23i X-Disclaimer: Any views expressed in this message,where not explicitly attributed otherwise, are mine alone!. X-Fortune: To be is to do. -- I. Kant To do is to be. -- A. Sartre Yabba-Dabba-Doo! -- F. Flinstone X-Operating-System: FreeBSD 4.4-STABLE i386 X-Best-Window-Manager: XFCE X-Designation: Systems Administrator, Wananchi Online Ltd. X-Location: Nairobi, KE, East Africa. X-Uptime: 12:33PM up 2 days, 20:34, 5 users, load averages: 0.46, 0.35, 0.21 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 --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello list, I am stuck with awk. What I need to do is for awk to read the /etc/master.passwd file and give m= e a line like this one below for users whose GID=3D20 or GID=3D0 I am not able to get the "\" after the ".*" and the $ after wananchi.com an= d I am also not able to get this done for users in GID=3D0 ^user2@.*\.wananchi.com$:1234:$1$Tz.OjMPg$5j5pGgjfUHFNlJaSLsr5P/: The command I use is: awk -F ":" '{if ($$4=3D=3D20) {print "^"$$1"@.*.wananchi.com"":"$$3= ":"$$2":"}}' < /etc/master.passwd > some_file -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 +++ Don't be humble ... you're not that great. -- Golda Meir --H+4ONPRPur6+Ovig 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 iD8DBQE77Ajqn7LIsuxjem8RAmNAAJ0dcKmEon7aIhB95eu3++JtTZLsiQCgtJup fb/blxjis5t3XdDKqkquckA= =5dX4 -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message