George Georgalis wrote:
I've written a script in sh (which is bash) which is executable
and in the $USER $PATH

when I was testing it, I used "sh doit.sh" and all was okay.

Problem is that script needs to generate files with the same umask
of $USER which is different from the system umask, and can change
from user to user.

Situation, when that is run as tested (login shell), all is fine.
a umask of 007 is applied to files created. But when it's deposited
in the $PATH directory and run as "doit.sh" it uses the system umask.

The script is launched how?
..as root, I gather.

Does the script need to be run as $USER (let's say 'geo')

If both above are so, and if this works as root
 su - geo -c doit.sh
then, you can maybe to create a wrapper containing that line?

Or equivalently just put this into doit.sh
  [ 0 -eq $UID ] && exec su - geo -c $0


Seems like there ought to be an easier way, though

Carl,  jhriv, other gurus?

..jim


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to