From owner-freebsd-questions Fri Feb 2 0:42:59 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dell.dannyland.org (dell.dannyland.org [64.81.36.13]) by hub.freebsd.org (Postfix) with ESMTP id 0000037B4EC for ; Fri, 2 Feb 2001 00:42:42 -0800 (PST) Received: by dell.dannyland.org (Postfix, from userid 1001) id 2191F5C1B; Fri, 2 Feb 2001 00:41:44 -0800 (PST) Date: Fri, 2 Feb 2001 00:41:44 -0800 From: dannyman To: Arcady Genkin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Change group ID in a shell script Message-ID: <20010202004144.A30084@dell.dannyland.org> References: <87vgqteb00.fsf@tea.thpoon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <87vgqteb00.fsf@tea.thpoon.com>; from antipode@thpoon.com on Fri, Feb 02, 2001 at 03:37:35AM -0500 X-Loop: djhoward@uiuc.edu X-URL: http://www.dannyland.org/~dannyman/ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Feb 02, 2001 at 03:37:35AM -0500, Arcady Genkin wrote: > I'm writing a script to be run from cron that needs to execute a > command with effective group ID different from my login group. > > How would I change effective GID in a shell script? Linux has sg(1) > command for this purpose. I couldn't find newgrp command, either. Are you creating a file that then has to end up in a certain group, or something? Assuming you are in a group, you can do what you want just fine. If you have to set the group on a file you create, you can then just chgrp. -danny To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message