File created under subshell does not keep subshell's umask settingHow do I tell if a regular file does not exist in Bash?How to have the cp command create any necessary folders for copying a file to a destinationopen() in Python does not create a file if it doesn't existPipes and prompts in Python CLI scriptsHow to create a file in Linux from terminal window?What does set -e mean in a bash script?Bash subshell mysteryHow is backgrounding a process implemented in terms of Linux system calls?When are bash variables exported to subshells and/or accessible by scripts?Why doesn't ''var=value echo $var'' emit value?

Is there a RAID 0 Equivalent for RAM?

Hero deduces identity of a killer

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

Why can Carol Danvers change her suit colours in the first place?

Does malloc reserve more space while allocating memory?

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

How should I respond when I lied about my education and the company finds out through background check?

How to cover method return statement in Apex Class?

On a tidally locked planet, would time be quantized?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

Why does the Sun have different day lengths, but not the gas giants?

The IT department bottlenecks progress. How should I handle this?

What is the highest possible scrabble score for placing a single tile

What if a revenant (monster) gains fire resistance?

Can a Canadian Travel to the USA twice, less than 180 days each time?

Why is it that I can sometimes guess the next note?

Do the primes contain an infinite almost arithmetic progression?

Can I say "fingers" when referring to toes?

Why "had" in "[something] we would have made had we used [something]"?

Terse Method to Swap Lowest for Highest?

How do you make your own symbol when Detexify fails?

Yosemite Fire Rings - What to Expect?



File created under subshell does not keep subshell's umask setting


How do I tell if a regular file does not exist in Bash?How to have the cp command create any necessary folders for copying a file to a destinationopen() in Python does not create a file if it doesn't existPipes and prompts in Python CLI scriptsHow to create a file in Linux from terminal window?What does set -e mean in a bash script?Bash subshell mysteryHow is backgrounding a process implemented in terms of Linux system calls?When are bash variables exported to subshells and/or accessible by scripts?Why doesn't ''var=value echo $var'' emit value?













-1















I'm trying to understand why subshell setting will be discard.



Under the subshell:



export UMASK=000 && touch output.file


Then back to the parent shell to output into output.file
But output.file has inherited parent shell's UMASK=007










share|improve this question









New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • By output into output.file, do you mean write to output.file

    – Sonny
    yesterday











  • Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

    – HardcoreHenry
    yesterday















-1















I'm trying to understand why subshell setting will be discard.



Under the subshell:



export UMASK=000 && touch output.file


Then back to the parent shell to output into output.file
But output.file has inherited parent shell's UMASK=007










share|improve this question









New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • By output into output.file, do you mean write to output.file

    – Sonny
    yesterday











  • Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

    – HardcoreHenry
    yesterday













-1












-1








-1








I'm trying to understand why subshell setting will be discard.



Under the subshell:



export UMASK=000 && touch output.file


Then back to the parent shell to output into output.file
But output.file has inherited parent shell's UMASK=007










share|improve this question









New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm trying to understand why subshell setting will be discard.



Under the subshell:



export UMASK=000 && touch output.file


Then back to the parent shell to output into output.file
But output.file has inherited parent shell's UMASK=007







linux bash






share|improve this question









New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









HardcoreHenry

1,587520




1,587520






New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









HZPHZP

1




1




New contributor




HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






HZP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • By output into output.file, do you mean write to output.file

    – Sonny
    yesterday











  • Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

    – HardcoreHenry
    yesterday

















  • By output into output.file, do you mean write to output.file

    – Sonny
    yesterday











  • Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

    – HardcoreHenry
    yesterday
















By output into output.file, do you mean write to output.file

– Sonny
yesterday





By output into output.file, do you mean write to output.file

– Sonny
yesterday













Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

– HardcoreHenry
yesterday





Unless you have some weird version of touch, then the UMASK environmnent variable will have no effect on the execution of touch. You could try adding ls -al output.file to the end of your subshell's command to confirm.

– HardcoreHenry
yesterday












1 Answer
1






active

oldest

votes


















2














Never heard of such an environment variable, use umask command instead:



umask 000 && touch output.file





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    HZP is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280861%2ffile-created-under-subshell-does-not-keep-subshells-umask-setting%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Never heard of such an environment variable, use umask command instead:



    umask 000 && touch output.file





    share|improve this answer





























      2














      Never heard of such an environment variable, use umask command instead:



      umask 000 && touch output.file





      share|improve this answer



























        2












        2








        2







        Never heard of such an environment variable, use umask command instead:



        umask 000 && touch output.file





        share|improve this answer















        Never heard of such an environment variable, use umask command instead:



        umask 000 && touch output.file






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday

























        answered yesterday









        oguzismailoguzismail

        3,98931326




        3,98931326






















            HZP is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            HZP is a new contributor. Be nice, and check out our Code of Conduct.












            HZP is a new contributor. Be nice, and check out our Code of Conduct.











            HZP is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280861%2ffile-created-under-subshell-does-not-keep-subshells-umask-setting%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript