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?
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
New contributor
add a comment |
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
New contributor
Byoutput into output.file
, do you meanwrite to output.file
– Sonny
yesterday
Unless you have some weird version oftouch
, then theUMASK
environmnent variable will have no effect on the execution oftouch
. You could try addingls -al output.file
to the end of your subshell's command to confirm.
– HardcoreHenry
yesterday
add a comment |
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
New contributor
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
linux bash
New contributor
New contributor
edited yesterday
HardcoreHenry
1,587520
1,587520
New contributor
asked yesterday
HZPHZP
1
1
New contributor
New contributor
Byoutput into output.file
, do you meanwrite to output.file
– Sonny
yesterday
Unless you have some weird version oftouch
, then theUMASK
environmnent variable will have no effect on the execution oftouch
. You could try addingls -al output.file
to the end of your subshell's command to confirm.
– HardcoreHenry
yesterday
add a comment |
Byoutput into output.file
, do you meanwrite to output.file
– Sonny
yesterday
Unless you have some weird version oftouch
, then theUMASK
environmnent variable will have no effect on the execution oftouch
. You could try addingls -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
add a comment |
1 Answer
1
active
oldest
votes
Never heard of such an environment variable, use umask
command instead:
umask 000 && touch output.file
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Never heard of such an environment variable, use umask
command instead:
umask 000 && touch output.file
add a comment |
Never heard of such an environment variable, use umask
command instead:
umask 000 && touch output.file
add a comment |
Never heard of such an environment variable, use umask
command instead:
umask 000 && touch output.file
Never heard of such an environment variable, use umask
command instead:
umask 000 && touch output.file
edited yesterday
answered yesterday
oguzismailoguzismail
3,98931326
3,98931326
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
By
output into output.file
, do you meanwrite to output.file
– Sonny
yesterday
Unless you have some weird version of
touch
, then theUMASK
environmnent variable will have no effect on the execution oftouch
. You could try addingls -al output.file
to the end of your subshell's command to confirm.– HardcoreHenry
yesterday