I think that's (cat | grep) is one of those things left over from long ago
and far slower machines.  cat makes a copy of the file as it pipes it into
grep, so that you have the /etc/passwd open for a shorter period of time.

Today?  Probably doesn't matter.

getent was in 3BSD, but the Linux version is dated 2001.

As to 97 vs. RH, you have to remember that RH is often (was often) quite
slow in picking up updates to the plumbing stuff.  There was a huge uproar
about moving from rpm 3 to rpm 4, and I seem to remember that it happened in
8...

Of course, none of the low-cost RHs are supported past the end of this
month, so...

-----Burton

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
> Of Kenneth Porter
> Sent: Tuesday, April 20, 2004 7:03 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [Ntop-dev] RPM spec file fix
>
>
> --On Tuesday, April 20, 2004 6:14 PM -0500 "Burton M. Strauss III"
> <[EMAIL PROTECTED]> wrote:
>
> > Interesting ... what version of RPM changed the setup macro?  (We have
> > some RH6.2 and 7.x users still... but mostly 8, 9.0 and FC1... if those
> > support it, it does look cleaner)
>
> Uh, good question! Using Google Groups I checked the RPM list for the
> oldest mention of the expression "setup -n" and found a post from
> December
> 1997. RH6.0 was released in 1999.
>
> BTW, I was looking at the %pre script and noticed the "cat /etc/passwd |
> grep ^ntop:" idiom. Why not just "grep ^ntop: /etc/passwd"? (And when I
> used that idiom, another RPM developer suggested I use the getent
> command.
> But I don't know how far back that was included in RH. I can find some
> pretty old references for other *nix but the oldest post I see
> with "getent
> passwd red hat" is in April of 2001. Isn't legacy support fun? ;) )
> _______________________________________________
> Ntop-dev mailing list
> [EMAIL PROTECTED]
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to