Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!preece%xenurus@gswd-vms.Gould.COM From: preece%xenurus@gswd-vms.Gould.COM (Scott E. Preece) Newsgroups: comp.unix.wizards Subject: umask and multiple groups Message-ID: <10265@brl-adm.ARPA> Date: Tue, 10-Nov-87 12:02:39 EST Article-I.D.: brl-adm.10265 Posted: Tue Nov 10 12:02:39 1987 Date-Received: Thu, 12-Nov-87 21:02:39 EST Sender: news@brl-adm.ARPA Lines: 32 What I've done is to make my umask change as I change directories. Thanks to aliases, this is no big deal. I do all my directory movement through aliased commands, which do things like remembering the last directory I was in, changing my prompt to show the directory I'm in, and set the umask. I only use two umasks, one for directories in my home tree and one for anything else, but it would be trivial to check for other paths and set appropriate umasks (or check the gid of the target directory and key off that). The umask manipulation is done by the um command in each of the actual directory-changing aliases. The dirs command is there for the benefit of GNU emacs shell sessions. The prompthead variable is assumed to have been set somewhere up above (I usually use the name of the machine the session is on, with highlighting around it tailored to the terminal I'm using). set prompt="$prompthead$cwd:t>" alias um 'eval umask 2`if ("$cwd" =~ *${user}*) echo 2`' alias back 'set back=$old; set old=$cwd; cd $back; um; unset back' umask 022 alias cd ' set old=$cwd;chdir \!*; um; set prompt="$prompthead$cwd:t>"; dirs' alias ">" ' pushd \!*; um; set prompt="$prompthead$cwd:t>"; dirs' alias "<" ' popd; um; set prompt="$prompthead$cwd:t>"; dirs' alias ".." ' cd ..; um; set prompt="$prompthead$cwd:t>"' alias mark 'set \!:1=`pwd`; alias \!:1 cd $\!:1' alias Mark mark \!:1 \; echo '>> ~/.cshrc' set \!:1 = `pwd` \\\; alias \!:1 cd '$'\!:1 -- scott preece gould/csd - urbana uucp: ihnp4!uiucdcs!ccvaxa!preece arpa: preece@Gould.com