Re: Get effective group id

2007-08-21 Thread Pieter de Goeje
On Tuesday 21 August 2007, Olivier Nicole wrote:
 Hi,

 From a Bourne shell script, how to get (and test) the group id of the

 user that is executing the script?

 Best regards,

 Olivier
id -g will get you the egid. 

if [ `id -g` -eq 1001 ]; then
echo It's a hit!
fi

Hope this helps,

Pieter de Goeje
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Get effective group id

2007-08-21 Thread Barry Byrne

 Hi,
 
 From a Bourne shell script, how to get (and test) the group id of the
 user that is executing the script?
 
 Best regards,

Olivier:

id -gn   should give you the group name. Drop the -n if you want just the
numberic id.

 - barry

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]