K.S. Bhaskar on 9 Feb 2010 19:25:06 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Equivalent of id for groups


Just checked on some UNIX systems... getent is there on a Solaris
SPARC system, but not on an AIX system or HP-UX system.  Any other
suggestions?  Thanks.

-- Bhaskar

On Fri, Feb 5, 2010 at 7:12 PM, Stephen Gran <steve@lobefin.net> wrote:
> On Fri, Feb 05, 2010 at 06:30:00PM -0500, K.S. Bhaskar said:
>> I can use the id command in a shell script to determine whether a user
>> is valid, e.g.,
>>
>> $ id -u auntsue
>> 9999
>> $ id -u xyzzy
>> id: xyzzy: No such user
>>
>> Is there an equivalent command to check for the validity of a group
>> name?  I can't scan /etc/group because the group may be defined by
>> NIS.  Ideally, it should be something that will work on Linux as well
>> as UNIX flavors.
>
> getent group xyzzy
> --
>  --------------------------------------------------------------------------
> |  Stephen Gran                  | I am here by the will of the people and |
> |  steve@lobefin.net             | I won't leave until I get my raincoat   |
> |  http://www.lobefin.net/~steve | back.   -- a slogan of the anarchists   |
> |                                | in Richard Kadrey's "Metrophage"        |
>  --------------------------------------------------------------------------
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFLbLQDSYIMHOpZA44RAkVUAKDJHwaZGPU5STYUw8y21R+0K+8fFQCgl5MW
> O4vsYHvMN9bFX+xA3cXzpm8=
> =xaV6
> -----END PGP SIGNATURE-----
>
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>
>



-- 
Windows does to computers what smoking does to humans
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug