home *** CD-ROM | disk | FTP | other *** search
- From decwrl!wyse!uunet!allbery Fri Mar 24 22:23:28 PST 1989
- Article 813 of comp.sources.misc:
- Path: decwrl!wyse!uunet!allbery
- From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
- Newsgroups: comp.sources.misc
- Subject: v06i044: Ridiculously fast&dirty finger "program"
- Keywords: Frogging fast finger.
- Message-ID: <50337@uunet.UU.NET>
- Date: 4 Mar 89 21:21:10 GMT
- Sender: allbery@uunet.UU.NET
- Reply-To: Mike Taylor <mirk%cs.warwick.ac.uk@NSS.Cs.Ucl.AC.UK>
- Followup-To: comp.unix.questions
- Organization: Computer Science, Warwick University, UK
- Lines: 41
- Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 6, Issue 44
- Submitted-by: @SRI-NIC.ARPA,@NSS.Cs.Ucl.AC.UK,@cu.warwick.ac.uk:news@warwick.UUCP
- Archive-name: finger.sed
-
-
- Hi guys - while learning to use sed(1), I found myself with an
- inescapable urge to write a version of finger that just seds a line of
- the password file. Here's the result: it runs *very* quickly, and
- obviously doesn't quite as much information as a "real" finger - but
- in the average, work-a-day drudgery, of tidal-waves and such-like,
- I reckon I'll shoot for the speed any day of the week.
-
- If you don't use the yellow pages password system, then replace the
- "ypmatch \!:* passwd" with an "egrep \!:* /etc/passwd": If you *do*
- use yp, then this won't work for uid's in the password *file*. If
- anyone has an elegant way around this,then please post followup to
- comp.unix.questions - I tried stuff like:
-
- ( ypmatch \!:* passwd ) >& /dev/null || egrep root /etc/passwd
-
- But this is stricken by the dreaded and cruddy csh(1) feature that
- redirects standard output along with standard error when you use ">&"
- Grrr! Unkle Mirk flames the csh-designers for this piece of stupidity.
-
- Anyway, here is the alias: obviously, it won't work with Bourne shell,
- which doesn't support aliases. It should work with all C-shells, I
- think, and I have no idea about ksh. Enjoy!
-
- /*--------------------------------------------------------------------------*/
-
- alias yff "ypmatch \!:* passwd | sed 's/\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^,]*\)[^:]*:\([^:]*\):\([^:]*\)/Login name: \1\\\
- Real name: \5\\\
- Home directory: \6\\\
- Shell: \7\\\
- Passwd: \2\\\
- (uid,gid): (\3,\4)\\\
- /'"
- ______________________________________________________________________________
- Mike Taylor - {Christ,M{athemat,us}ic}ian ... Email to: mirk@uk.ac.warwick.cs
- Unkle Mirk sez: "You fritter and waste the hours in an offhand waistcoat." :-)
- ------------------------------------------------------------------------------
-
-
-