[TriLUG] possible awk/grep question

jonc at nc.rr.com jonc at nc.rr.com
Tue Jan 1 12:19:54 EST 2008


A little further offtopic but, I was playing with "getent" (on CentOS) and noticed that it only returns the first entry that matches its query. This could be misleading. As an example,
  getent services domain
    domain                53/tcp

which ignores the UDP entry (which is listed 2nd in the /etc/services file)... Perhaps I'm being too picky :-)

Jon Carnes

If you were using it for troubleshooting, you could end up going down the wrong rabbit hole.
---- Magnus <magnus at trilug.org> wrote: 
> On Dec 31, 2007, at 9:38 AM, Joseph Mack NA3T wrote:
> 
> > getent was in another posting here awhile ago and not having
> > seen it before, I had to look it up with google. But not
> > having any reason to use it, I forgot about it. I think I'd
> > better use it in my script or I'll forget it again.
> 
> I think getent is better to use than depending on /etc/passwd because  
> if you use any sort of directory service, getent will pull from it.   
> It makes your scripts/aliases a lot more flexible that way.
> 
> -- 
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/




More information about the TriLUG mailing list