From owner-freebsd-questions@FreeBSD.ORG Tue Aug 21 09:28:32 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4817816A41A for ; Tue, 21 Aug 2007 09:28:32 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from smtp.utwente.nl (unknown [IPv6:2001:610:1908:1000:204:23ff:feb5:7e66]) by mx1.freebsd.org (Postfix) with ESMTP id BBC3A13C465 for ; Tue, 21 Aug 2007 09:28:31 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from lux.student.utwente.nl (lux.student.utwente.nl [130.89.170.81]) by smtp.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id l7L9S7j1028735; Tue, 21 Aug 2007 11:28:08 +0200 From: Pieter de Goeje To: freebsd-questions@freebsd.org Date: Tue, 21 Aug 2007 11:28:06 +0200 User-Agent: KMail/1.9.7 References: <200708210720.l7L7KRpU091443@banyan.cs.ait.ac.th> In-Reply-To: <200708210720.l7L7KRpU091443@banyan.cs.ait.ac.th> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708211128.07123.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: Olivier Nicole Subject: Re: Get effective group id X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2007 09:28:32 -0000 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