[oclug] umask for one dir only?
rjordan at blanch.math.uwaterloo.ca
Wed Feb 21 21:15:19 EST 2001
> On Wed, 21 Feb 2001, Jonathan Earle wrote:
> > Is that possible? How do you implement that?
> > Cheers!
> > Jon
> I do not thing that this is possible if you only want to do this for one
> dir then a better choice would be chmod see "man chmod" on how to use
> thiis function if you need to. chmod is used to change the permissions on
> 1 or moer fles and directories.
You could do it with a alias/hack of the cd command.
Stick files called .mode in each directory you want a non-default
mode on. Also define a defaultmode environment variable.
Then alias your cd command to be (assumes a bash shell):
alias cd="cd $1;mode=$defaultmode; if [ -f .mode ]; then mode=\`cat .mode\`;fi; chmod $mode"
Probably not a perfect solution, but it seems to do the trick.
More information about the OCLUG