Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-18-2003, 03:22 PM   #1
Registered: Oct 2002
Posts: 32

Rep: Reputation: 15
.profile and umask


I just update my .profile file to change

umask 077 to 177

and after that there is a umask command to see the update after running my .profile from the command line.

the output that I get is 0177

but when I issue umask command I found it is still 077. Why is that?
and how to update my setting in the real time from the .profile?

Old 12-18-2003, 05:40 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910

Firstly it would help if we knew which
shell you're using :)

I'll assume it's bash....

Here's an excerpt from "man bash" that
you should read carefully.

       When bash is invoked as an interactive login shell, or  as
       a  non-interactive shell with the --login option, it first
       reads and executes commands from the file /etc/profile, if
       that  file  exists.  After reading that file, it looks for
       ~/.bash_profile, ~/.bash_login, and  ~/.profile,  in  that
       order,  and reads and executes commands from the first one
       that exists and is readable.  The --noprofile  option  may
       be  used  when the shell is started to inhibit this behav-
That means that if you don't invoke bash as a login-shell,
it won't touch .profile.
It also means that if it find's .bash_login, or .bash_profile,
it won't touch .profile either.

Old 12-18-2003, 07:28 PM   #3
Registered: Oct 2002
Posts: 32

Original Poster
Rep: Reputation: 15
Korn Shell

I'm actually using Korn.

It works fine if I "Exit" Log off and log on again. But it doesn't work if I update the .profile in the middle of the session and try to run it from command line


(because I have umask follows umask 177)

and even after that, when I type umask from the command line it is still 077.

Old 12-18-2003, 10:18 PM   #4
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Rep: Reputation: 15
use .bashrc file for such cases!

Well, in the bash manpage, for changes "on the fly" you can use the .bashrc file as stated below.

       When an interactive shell that is not a login shell  is  started,  bash
       reads  and executes commands from ~/.bashrc, if that file exists.  This
       may be inhibited by using the --norc option.  The --rcfile file  option
       will  force  bash  to  read  and  execute commands from file instead of
After modifying .bashrc, you will only have to start a new xterm and the changes will immediately take effect.

Don't know much about korn shell and did not find a man page for that on my system either , but have a try with .bashrc and be kind to let us know if it works.


Last edited by realos; 12-18-2003 at 10:19 PM.


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
Umask metallica1973 Linux - Software 4 11-27-2005 02:21 PM
umask help glabiche Linux - Security 1 06-07-2005 09:20 AM
umask wbdune Linux - Newbie 5 10-14-2003 02:53 AM
umask knueven7 Linux - Newbie 8 04-18-2003 08:30 AM
Umask def1014 Linux - Security 3 06-21-2002 05:05 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:50 PM.

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