http://qs321.pair.com?node_id=1232373


in reply to Re^2: umask when calling xterm from perl
in thread umask when calling xterm from perl

If all of these shells have the same umask when I call them manually, why does the umask get changed when perl calls a different shell (/bin/sh in this case)?

That is the key question. I'm unable to reproduce your findings regarding the different umasks but then our operating systems (and maybe shells and maybe perls) are probably quite different. I suggest that instead of fixing just on umask you look at the entire environment to determine what is being set/reset and hopefully by that method determine the cause. If umask turns out to be the only difference then that may point to a bug somewhere.

  • Comment on Re^3: umask when calling xterm from perl

Replies are listed 'Best First'.
Re^4: umask when calling xterm from perl
by Special_K (Monk) on Apr 10, 2019 at 15:42 UTC
    Would the best way to do this be to just run "env" before calling the xterm and then within the new xterm, and then diff'ing the 2 results?

      Yes, that's what I would do. You'll probably have to sort before diff'ing as env itself rarely sorts the output.

        I ran system("env > ~/env_before_xterm") in perl right before launching the xterm window, and then in the xterm window I ran "env > ~/env_within_xterm. When I diff the results, the only differences are the following variables:

        MANPATH PWD REMOTEHOST SHLVL TMPDIR WINDOWID _

        Additionally, the following variables are present in the env inside the xterm but not in the env within perl:

        XTERM_LOCALE XTERM_SHELL XTERM_VERSION

        None of these seem to have anything to do with umask values. Is there anything else I can check?