You might be able to, with considerable effort, get your shell to do this for you. However, it's going to be a lot easier to just set the umask in each of your scripts to whatever you desire. Alternatively, if the umask you want for that directory is one you can live with as your default, set it in your shell's dotfiles. As yet another option that's kind of crude, you might create a special account with a default umask set to your choice, have it run the scripts, and use sudo, if you run them interactively. On most flavors of unix (including Linux) though, you're not going to be able to do exactly what you want. For flavors that can do what you want, the capability is often present in the ACL facilities, so do an 'apropos acl' to figure out what manpages to look at. Note also that on Linux, ACLs are probably going to be showing up in mainstream distributions within the next year or so.

In reply to Re: Umask by Improv
in thread More permanent umask ? by Gorby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.