Skip site navigation (1)Skip section navigation (2)
Date:      02 Feb 2001 03:54:26 -0500
From:      Arcady Genkin <a.genkin@utoronto.ca>
To:        dannyman <dannyman@toldme.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Change group ID in a shell script
Message-ID:  <87r91hea7x.fsf@tea.thpoon.com>
In-Reply-To: <20010202004144.A30084@dell.dannyland.org>
References:  <87vgqteb00.fsf@tea.thpoon.com> <20010202004144.A30084@dell.dannyland.org>

next in thread | previous in thread | raw e-mail | index | archive | help
dannyman <dannyman@toldme.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87r91hea7x.fsf>