Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2001 18:08:39 +0300
From:      Odhiambo Washington <wash@wananchi.com>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        FBSD-Q <freebsd-questions@freebsd.org>
Subject:   Re: another easy one for the script gurus
Message-ID:  <20010829180839.F7356@ns2.wananchi.com>
In-Reply-To: <20010828233939.A12493@hades.hell.gr>
References:  <20010828191422.P14463@ns2.wananchi.com> <20010828233939.A12493@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help

--ZfOjI3PrQbgiZnxM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Giorgos Keramidas <keramida@ceid.upatras.gr> [20010829 00:47]: writing on=
 the subject 'Re: another easy one for the script gurus'
| From: Odhiambo Washington <wash@wananchi.com>
| Subject: another easy one for the script gurus
| Date: Tue, Aug 28, 2001 at 07:14:22PM +0300
|=20
| > This time I need help in extracting usernames and passwords from the fi=
le
| > /etc/master.passwd.
| >=20
| > What I have in mind, if someone can help me, is a Makefile type of scri=
pt.
| > I want to place it somewhere and all I want to do is to=20
| >=20
| > cd /path/to/Makefile
| > make
| >=20
| > ..and I should end up getting _somefilename_ which contains two columns:
| >=20
| > username1:encryptedpasswd
| > username2:encryptedpasswd
| >=20
| > thanking you all in advance.
|=20
| You want in your Makefile something along the lines of:
|=20
| 	somefilename:
| 		awk -F: '{print $$1,$$2}' < /etc/master.passwd > $@
|=20

Hi giorgos,

I've tried my hands on awk today ;).
The command below seems to do what I want when I use it on the command
line

cat master.passwd.test | awk -F ":" '{if ($3>999) {print $1":"$2}}' > autht=
ab

However, with my inexperience, I cannot conjure up a Makefile to use it
with. My Makefile is something like this;

##
authtab:
	cat master.passwd.test | awk -F ":" '{if ($3>999) {print $1":"$2}}'=20
##
In all that I expect it to generate the file called authtab.

If I try your redirects (BTW what does $@ represent?) It generates errors

alligator# make
awk -F ":" '{if (>999) {print ":"}}' < master.passwd.test > authtab
awk: cmd. line:1: {if (>999) {print ":"}}
awk: cmd. line:1:      ^ syntax error
*** Error code 1
Stop in /etc/Exim.

I don't get where the $3 disappears to.

I've read the 'make' man page but still it just doesn't ring a bell.

I'm certain someone already sees my mistake, yes? Something that's missing
in the Makefile??


TIA


-Wash

--
Odhiambo Washington
Wananchi Online Ltd.,
wash@wananchi.com 1st Flr Loita Hse.
Tel: 254 2 313985 Loita Street.,
Fax: 254 2 313922 PO Box 10286,00100-NAIROBI,KE.

Any girl can be glamorous; all you have to do is stand still and look stupi=
d.=20
-Hedy Lamarr=20

--ZfOjI3PrQbgiZnxM
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

iD8DBQE7jQV3n7LIsuxjem8RAuSVAKCTvtiX5VE5+hJu9ueEvwGLi2kdbACgh6tC
83/jaoxAfAJdIZmViV/maIU=
=Ax5V
-----END PGP SIGNATURE-----

--ZfOjI3PrQbgiZnxM--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010829180839.F7356>