LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 106Reputation: 106
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.

Code:
umask=0027
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, 08:11 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi

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

Code:
umask 0027
 
Old 12-23-2010, 08:23 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

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
Code:
umask 0027
at some point. Or, if you want to use the variable then it should be
Code:
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:
Code:
--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, 02:42 PM   #4
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Original Poster
Rep: Reputation: 106Reputation: 106
Cool

Thanks for the replies.

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

Happy Holidays !!!
 
  


Reply



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 07:27 AM
bash not reading bashrc exvor Linux From Scratch 2 11-30-2009 12:04 AM
[SOLVED] .bashrc cant get rid of (bash 3.2#) hunnykhan3 Linux - General 11 08-24-2009 10:39 AM
/etc/bash.bashrc sulekha Ubuntu 1 11-05-2008 06:58 AM
/etc/profile vs. /etc/bash.bashrc jbrashear Debian 3 03-11-2004 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:21 PM.

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