On Fri, 20 Jun 2003, Bret Hughes wrote:

> On Fri, 2003-06-20 at 09:31, Jianping Zhu wrote:

> > Can you give me an example how the extra file looks like.
> > i want root has umask 022 and regular usr have u mask 002.
> > Thank you again!
> > 
> 
> probably something like this would work
> 
> put the following text into a file called /etc/profile.d/mask.sh
> 
> if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ];
> then
>  # for bash, pdksh and zsh, set the umask
>   umask 0002
> fi


  if you want to do something different for regular users as opposed
to root, there's a good example of how to do that in the current
RH 9 /etc/profile file:

----------------

if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi

----------------

this test is checking if the invoker is root, and doing something
appropriate.  if it wasn't root, you could do something else.

  an easier solution would be to just flat out set the umask to 002, and
in root's *personal* .bashrc, set it to 022 to override that value.  
that's a much more straightforward solution.


rday

p.s.  for a zillion really handy scripts, i strongly recommend
cameron simpson's script archive:

  http://www.cskk.ezoshosting.com/cs/

lots's of neat ideas for time-saving utilities.

--

Robert P. J. Day
Eno River Technologies
Unix, Linux and Open Source training
Waterloo, Ontario

www.enoriver.com


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to