Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site luke.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!mtunh!mtung!mtunf!ariel!vax135!cornell!uw-beaver!tektronix!hplabs!oliveb!bene!luke!steven From: steven@luke.UUCP (Steven List) Newsgroups: net.unix Subject: Re: data bases such as /etc/passwd Message-ID: <226@luke.UUCP> Date: Sun, 16-Jun-85 14:55:00 EDT Article-I.D.: luke.226 Posted: Sun Jun 16 14:55:00 1985 Date-Received: Thu, 20-Jun-85 09:20:34 EDT References: <448@cmu-cs-k.ARPA> <298@bdaemon.UUCP> Reply-To: steven@luke.UUCP (Steven List) Organization: Uncle Bene's Farm Lines: 25 Summary: In article <298@bdaemon.UUCP> carl@bdaemon.UUCP (carl) writes: >> I am working on a program which will have a data base similar to /etc/passwd >> or /etc/inittab. Are there any libraries which support these type of files? >> Specifically, I would like to be able to search for a record based on a >> certain key, and ask for the nth field in that record. > >Why not: > > grep key file | awk -F: 'print $n' > >where $n is the nth field? > >Cral Brandauer ^^^^? How about: grep "^key" file | awk -F: '{print $n}' Good advice is only good if it's accurate. -- *** * Steven List @ Benetics Corporation, Mt. View, CA * {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!steven ***