[Gllug] How to set umask

Stuart Sears stuart at sjsears.com
Sun Aug 1 20:26:30 UTC 2004


On Sunday 01 August 2004 21:01, Garry Heaton wrote:
> Only /etc/bashrc makes mention of umask so I commented out:
>
> if ["`id -gn`" = "`id -un`" -a `id -u` -gt 99]; then
if your Group ID = your User ID and your User ID > 99
(ie if you are a non-system user)
>   umask 002
> else
(if you are a system user)
>   umask 022
> fi
> It worked at next login but I'm sure there's a hidden catch :-( as I
> haven't a clue what the if,else condition refers to. Still can't work out
> why my .bash_profile and .bashrc entries didn't over-ride this setting.
they will, if you put the command in the correct place
the way that RH/Fedora bash startup files work is...
[for bash] 
login shells:
/etc/profile -> any scripts in /etc/profile.d/ -> ~/.bash_profile ->  
~/.bashrc, -> /etc/bashrc
nonlogin shells:
~/.bashrc -> /etc/bashrc -> any scripts in the /etc/profile.d/*  dir

If you put your command in as the last command in ~/.bashrc
(after the /etc/bashrc lines) it should work for every shell you start

equally it shoud work as the _last_ command in ~/.bash_profile - but you won't 
see an instant change, it will only work the next time you start a login 
shell. ie log in to X or on a text console.

putting it in the global bashrc file will affect every user on the system.
( I assume this is what you wanted?)

Stuart
-- 
Stuart Sears RHCE, RHCX
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list