Operating System - HP-UX
1748195 Members
4228 Online
108759 Solutions
New Discussion юеВ

umask not taken effect !!!

 
SOLVED
Go to solution
Ahmed_58
Regular Advisor

umask not taken effect !!!

Hi,
I add umask 022 to my .profile to change premission group with "w" but no changes happen to the umask setting. I did logoff/login again, but no change! I also done through command line but no change, see below;

$ umask -S

u=rwx,g=rx,o=rx
$ umask u=rwx,g=rw,o=rx
$ umask -S
& u=rwx,g=rw,o=rx
$ cal > test
$ ll test
-rw-rw-r-- 1 pin pin 225 May 7 11:09 test
4 REPLIES 4
Steven E. Protter
Exalted Contributor
Solution

Re: umask not taken effect !!!

Shalom Ahmed,

Its being overridden elsewhere.

Two easy ways to check.

create a new user that only uses /etc/profile and .profile

Make sure .profile is correct.

re-run your test.

If its still a problem, then there is something after the umask statement in .profile overriding umask.

This is quite common.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ahmed_58
Regular Advisor

Re: umask not taken effect !!!

Hi Steve,
But if you see the example i try through command line !!
$ umask u=rwx,g=rw,o=rx
$ umask -S
& u=rwx,g=rw,o=rx
$ cal > test
$ ll test
-rw-rw-r-- 1 pin pin 225 May 7 11:09 test

Ahmed
Ninad_1
Honored Contributor

Re: umask not taken effect !!!

Hi,

As pointed out above it seems that umask is being set somewhere else as well apart from your .profile.
Is it defined anywhere in $HOME/.kshrc (for ksh sehll) or $HOME/.cshrc (for csh )
or try adding the umask 022 command as the last line in your .profile, if you are not able to trace where else umask is defined, so that this is the last command in your .profile that will be executed and will override any settings done.
But mind you if umask is being set in any shell startup script that setting will override incase you invoke any subshells or execute any commands with ksh shellprogram.ksh

Regards,
Ninad
Ahmed_58
Regular Advisor

Re: umask not taken effect !!!

Tanks guys,
found the problem the persmiision I was using was wrong, I should use 002, anyway it is woking now.

Regards,
Ahmed