From owner-freebsd-questions Fri Feb 2 0:54:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.thpoon.com (cr103675-a.bloor1.on.wave.home.com [24.42.106.79]) by hub.freebsd.org (Postfix) with SMTP id A333D37B491 for ; Fri, 2 Feb 2001 00:54:27 -0800 (PST) Received: (qmail 53366 invoked from network); 2 Feb 2001 08:54:26 -0000 Received: from unknown (HELO tea.thpoon.com) (mail@192.168.1.2) by cr103675-a.bloor1.on.wave.home.com with SMTP; 2 Feb 2001 08:54:26 -0000 Received: from antipode by tea.thpoon.com with local (Exim 3.12 #1 (Debian)) id 14Obz8-0006U3-00; Fri, 02 Feb 2001 03:54:26 -0500 To: dannyman Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Change group ID in a shell script References: <87vgqteb00.fsf@tea.thpoon.com> <20010202004144.A30084@dell.dannyland.org> X-Face: 0=A/O5-+sE[Tf%X>rYr?Y5LD4,:^'jaJ!4jC&UR*ZrrK2>^`g22Qeb]!:d;}2YJ|Hq"LHdF OX`jWX|AT-WVFQ(TPhFVak)0nt$aEdlOq=1~D,:\z5QlVOrZ2(H,mKg=Xr|'VlHA="r From: Arcady Genkin Date: 02 Feb 2001 03:54:26 -0500 In-Reply-To: <20010202004144.A30084@dell.dannyland.org> Message-ID: <87r91hea7x.fsf@tea.thpoon.com> Lines: 21 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Channel Islands) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG dannyman writes: > > 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. No, I chgrp is not what I want. I'm running rsync to mirror a directory over network, so rsync can potentially create a bunch of new files. I can't set sticky bit for the directory either, because its parent directory is not owned by me. -- Arcady Genkin Nostalgia isn't what it used to be. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message