Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Plenty of examples on how to set umask for a user... but how do you read (or uncover) the default umask for a given user (say the logged in user)

share|improve this question
    
Note that umask is not associated with a user but with a process. –  Stéphane Chazelas Jan 28 '13 at 21:31
    
ic. so what I think I want, ideally, is for the umask to change to 002 whenever I run a particular command ($ brew …) but it can default back to 022 at all other times. possible or wishful thinking? –  Meltemi Jan 28 '13 at 23:56
add comment

2 Answers

up vote 5 down vote accepted

With the umask command...

dennis@lightning:~$ umask
0002
share|improve this answer
    
LOL- well, that was easy (read: obvious)! thx –  Meltemi Jan 28 '13 at 21:25
add comment

To make sure a command is called with a specific command, you could wrap it inside a script or a function that starts a subshell with the umask updated. You could put that function definition in your shell configuration file like .bashrc for bash or .zshrc for zsh.

Something like:

brew() (
  umask 002 &&
    command brew "$@"
)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.