Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-23-2010, 08:21 AM   #1
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
Question Umask -> Bash.bashrc file ?

I have set my umask parameter below in my /etc/bash.bashrc file but the value comes up as 0022.

What am I doing wrong ? Or what am I not understanding ?

My end goal is to ensure that all files can't be deleted/edited by anyone but the owner/root and the users within the group can read them. Is this the correct value ?

Thank You in advance for your time.
Old 12-23-2010, 09:11 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,317

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350

The number seems right, but you should use umask without the =. Try this instead:

umask 0027
Old 12-23-2010, 09:23 AM   #3
Senior Member
Registered: Jan 2010
Posts: 1,665

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492

all your code does is assign the value '0027' to a variable named 'umask'. To actually change the umask value you will have to issue
umask 0027
at some point. Or, if you want to use the variable then it should be
umask $umask
Possible error sources are that your script might not issue the actual umask command or it is not being sourced at all. Please post your complete /etc/bash.bashrc and your ~/.bashrc file. Chances are that the value is overwritten at some point. Also note, that if bash is called with 'sh' it default to --norc option:
--norc        Do not read and execute  the  system  wide  initialization  file
              /etc/bash.bashrc  and the personal initialization file ~/.bashrc
              if the shell is interactive.  This option is on  by  default  if
              the shell is invoked as sh.
Old 12-23-2010, 03:42 PM   #4
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Original Poster
Rep: Reputation: 103Reputation: 103

Thanks for the replies.

My Syntax was off. I changed to umask 0027 (less = ) and it I was all set.

Happy Holidays !!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get Bash to reread the bashrc file? will103 Linux - Software 11 04-13-2011 08:27 AM
bash not reading bashrc exvor Linux From Scratch 2 11-30-2009 01:04 AM
[SOLVED] .bashrc cant get rid of (bash 3.2#) hunnykhan3 Linux - General 11 08-24-2009 11:39 AM
/etc/bash.bashrc sulekha Ubuntu 1 11-05-2008 07:58 AM
/etc/profile vs. /etc/bash.bashrc jbrashear Debian 3 03-11-2004 04:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration