Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: umask when calling xterm from perl

by hippo (Bishop)
on Apr 09, 2019 at 21:25 UTC ( [id://1232373]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1232373]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found