LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-18-2003, 02:22 PM   #1
ALF
Member
 
Registered: Oct 2002
Posts: 32

Rep: Reputation: 15
.profile and umask


Hi,

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?

Alf
 
Old 12-18-2003, 04:40 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hello...

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.

Code:
       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-
       ior.
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.


Cheers,
Tink
 
Old 12-18-2003, 06:28 PM   #3
ALF
Member
 
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

$.profile
0177


(because I have umask follows umask 177)

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

Alf
 
Old 12-18-2003, 09:18 PM   #4
realos
Member
 
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.

Code:
       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
       ~/.bashrc.
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.

cheers,

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:34 AM.

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