in reply to Re: invoking umask command in perl
in thread invoking umask command in perl

I tried using the built in perl umask function but it doesn't change the default umask for root. The script is running with root priveleges, but either using backticks or the built in perl umask function doesn't change the default umask for root.

Replies are listed 'Best First'.
Re^3: invoking umask command in perl
by roboticus (Chancellor) on Jun 02, 2011 at 03:37 UTC

    austin43:

    Right. If you want to change the default umask for root, then edit the .bashrc for root (assuming a bash shell). Perl's umask simply sets the umask for the currently-running perl script, it doesn't attempt to change the umask setting for anything else. Even in bash, running umask won't set the default value for root, it only sets the value used in the current session. That's why .bashrc and .bash_profile exist--to allow you to set up the account defaults.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.