Subject: Perl, Lisp, scripting, etc. [was: CDR-coding ... ]
From: (Rob Warnock)
Date: 19 Dec 2000 07:29:38 GMT
Newsgroups: comp.lang.lisp
Message-ID: <91n2p2$cpk2o$>
[Trimmed newsgroups, retargeted subject to match content...]

Peter da Silva <> wrote:
| Rob Warnock <> wrote:
| > Sheesh! Hey, c'mon, Peter, you know better than that:
| > 	egrep /sbin/nologin /etc/passwd | sed -e 's/:.*$//'
| > And it's even fewer characters to type than the Perl version!!  ;-}  ;-}
| What Perl version? I haven't given a Perl version.

Sorry, I guess I mis-read your article <URL:news:91eafr$>
that started this whole sub-thread, where you said:

	Because you can write two lines of Perl and have a program that
	does something useful on just about any popular OS widely used today.
	Provide a "lispscript" tool that lets you write, oh:
            awk 'BEGIN {FS=":"}; $6=="/sbin/nologin" {print $1}' /etc/passwd

and not being very fluent in Perl myself, I assumed that you were using
some "awk" sub-command of Perl and not the old Unix command-line Awk
program (since obsoleting Awk is one of Perl's main claims to fame).

| And what happens if someone's GCOS name is /sbin/nologin? Try:
|  	egrep ":/sbin/nologin$" /etc/passwd | sed -e 's/:.*$//'

Thanks for the bug fix.

But even with the fix, it's *still* shorter than the Awk version.
And not only that, it works regardless of how many fields (7 or 8)
the passwd file contains (as someone else was worrying about).


Rob Warnock, 31-2-510
Network Engineering
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043