Wildcards not interpreted by shell script when used with output redirectionHow can I have more than one possibility in a script's shebang line?cron ignores variables defined in “.bashrc” and “.bash_profile”How to make my bash script be able to create an log file for a clamscan running in cron?Cron Bash Script - echo to current terminal instead of /var/spool/mail/rootRemote SSH command fails only in shell script with error: “No such file or directory”Cron shell ignores runuser command - why?Getting no output from command substitution?How to run different python scripts from command line by passing the script name as argumentIn bash, how can I export/set a global variable from a read funtion inside a script, for use in a second script and a config file later on?“sudo -s <command>” runs command in a shell, but wildcards or metacharacters not working
Are there any satellites in geosynchronous but not geostationary orbits?
"Je suis petite, moi?", purpose of the "moi"?
Three Subway Escalators
Why doesn't Venus have a magnetic field? How does the speed of rotation affect the magnetic field of a planet?
How to tell if JDK is available from within running JVM?
How many opportunity attacks can you make per turn before becoming exhausted?
Does 5e follow the Primary Source rule?
The most secure way to handle someone forgetting to verify their account?
When will the last unambiguous evidence of mankind disappear?
Is it possible to have a career in SciComp without contributing to arms research?
Why isn't a binary file shown as 0s and 1s?
Should I have shared a document with a former employee?
How can I automate this tensor computation?
What is a Romeo Word™?
What's a German word for »Sandbagger«?
Manager asking me to eat breakfast from now on
How did Jayne know when to shoot?
How to belay quickly ascending top-rope climbers?
Could a US citizen born through "birth tourism" become President?
Did Hitler say this quote about homeschooling?
Changing iteration variable in Do loop
I have found a mistake on someone's code published online: what is the protocol?
Why aren't there any women super GMs?
What is this green alien supposed to be on the American covers of the "Hitchhiker's Guide to the Galaxy"?
Wildcards not interpreted by shell script when used with output redirection
How can I have more than one possibility in a script's shebang line?cron ignores variables defined in “.bashrc” and “.bash_profile”How to make my bash script be able to create an log file for a clamscan running in cron?Cron Bash Script - echo to current terminal instead of /var/spool/mail/rootRemote SSH command fails only in shell script with error: “No such file or directory”Cron shell ignores runuser command - why?Getting no output from command substitution?How to run different python scripts from command line by passing the script name as argumentIn bash, how can I export/set a global variable from a read funtion inside a script, for use in a second script and a config file later on?“sudo -s <command>” runs command in a shell, but wildcards or metacharacters not working
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Say I have two scripts:
script1.sh:
#!/bin/bash
version=2.6
log_file="$HOME/log-file-version-$version.log"
touch $log_file &>/dev/null
echo "log to my log file from script 1" >> $HOME/log-file-version-?.?.log
gnome-terminal --tab --active --title="script2" -- sh script2.shscript2.sh:
#!/bin/bash
echo "log to my log file from script 2" >> $HOME/log-file-version-?.?.log
I run script1.sh
.
I'm left with two log files in my home:
log-file-version-2.6.log
log-file-version-?.?.log
log-file-version-2.6.log
contains:
log to my log file from script 1
log-file-version-?.?.log
contains:
log to my log file from script 2
which means that in script 1 the wildcards from line 7 (>> $HOME/log-file-version-?.?.log
) were correctly interpreted, but when a script is run with sh
these wildcards don't work.
Why is that and how can I fix this?
I need to use wildcards because I don't want to be passing arguments from shell script to shell script and I want them to be self-sufficient.
I'm using Ubuntu and running these scripts from the default terminal which is gnome-terminal.
bash shell-script shell scripting wildcards
add a comment |
Say I have two scripts:
script1.sh:
#!/bin/bash
version=2.6
log_file="$HOME/log-file-version-$version.log"
touch $log_file &>/dev/null
echo "log to my log file from script 1" >> $HOME/log-file-version-?.?.log
gnome-terminal --tab --active --title="script2" -- sh script2.shscript2.sh:
#!/bin/bash
echo "log to my log file from script 2" >> $HOME/log-file-version-?.?.log
I run script1.sh
.
I'm left with two log files in my home:
log-file-version-2.6.log
log-file-version-?.?.log
log-file-version-2.6.log
contains:
log to my log file from script 1
log-file-version-?.?.log
contains:
log to my log file from script 2
which means that in script 1 the wildcards from line 7 (>> $HOME/log-file-version-?.?.log
) were correctly interpreted, but when a script is run with sh
these wildcards don't work.
Why is that and how can I fix this?
I need to use wildcards because I don't want to be passing arguments from shell script to shell script and I want them to be self-sufficient.
I'm using Ubuntu and running these scripts from the default terminal which is gnome-terminal.
bash shell-script shell scripting wildcards
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago
add a comment |
Say I have two scripts:
script1.sh:
#!/bin/bash
version=2.6
log_file="$HOME/log-file-version-$version.log"
touch $log_file &>/dev/null
echo "log to my log file from script 1" >> $HOME/log-file-version-?.?.log
gnome-terminal --tab --active --title="script2" -- sh script2.shscript2.sh:
#!/bin/bash
echo "log to my log file from script 2" >> $HOME/log-file-version-?.?.log
I run script1.sh
.
I'm left with two log files in my home:
log-file-version-2.6.log
log-file-version-?.?.log
log-file-version-2.6.log
contains:
log to my log file from script 1
log-file-version-?.?.log
contains:
log to my log file from script 2
which means that in script 1 the wildcards from line 7 (>> $HOME/log-file-version-?.?.log
) were correctly interpreted, but when a script is run with sh
these wildcards don't work.
Why is that and how can I fix this?
I need to use wildcards because I don't want to be passing arguments from shell script to shell script and I want them to be self-sufficient.
I'm using Ubuntu and running these scripts from the default terminal which is gnome-terminal.
bash shell-script shell scripting wildcards
Say I have two scripts:
script1.sh:
#!/bin/bash
version=2.6
log_file="$HOME/log-file-version-$version.log"
touch $log_file &>/dev/null
echo "log to my log file from script 1" >> $HOME/log-file-version-?.?.log
gnome-terminal --tab --active --title="script2" -- sh script2.shscript2.sh:
#!/bin/bash
echo "log to my log file from script 2" >> $HOME/log-file-version-?.?.log
I run script1.sh
.
I'm left with two log files in my home:
log-file-version-2.6.log
log-file-version-?.?.log
log-file-version-2.6.log
contains:
log to my log file from script 1
log-file-version-?.?.log
contains:
log to my log file from script 2
which means that in script 1 the wildcards from line 7 (>> $HOME/log-file-version-?.?.log
) were correctly interpreted, but when a script is run with sh
these wildcards don't work.
Why is that and how can I fix this?
I need to use wildcards because I don't want to be passing arguments from shell script to shell script and I want them to be self-sufficient.
I'm using Ubuntu and running these scripts from the default terminal which is gnome-terminal.
bash shell-script shell scripting wildcards
bash shell-script shell scripting wildcards
edited 55 mins ago
Anthony Geoghegan
8,2435 gold badges40 silver badges55 bronze badges
8,2435 gold badges40 silver badges55 bronze badges
asked 13 hours ago
tatsutatsu
1868 bronze badges
1868 bronze badges
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago
add a comment |
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago
add a comment |
2 Answers
2
active
oldest
votes
i believe it is because the ?
wildcard is a bash feature, not shell (sh).
Try running
gnome-terminal --tab --active --title="script2" -- bash script2.sh
When you run ./script1.sh
it defaults to using bash
as instructed on the 1st line. However, when you run sh script2.sh
you use the shell to interpret the commands, and it ignores the recommendation from the 1st line.
New contributor
the?
is and always was ash
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.
– Uncle Billy
41 mins ago
add a comment |
The bash manual has this to say in the 3.6 Redirections section:
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word splitting. If it expands to more than one word, Bash reports an error.
sh
does not do that: from the POSIX shell specification
If the redirection operator is "
<<
" or "<<-
", [...]. For the other redirection operators, the word that follows the redirection operator shall be subjected to tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion shall not be performed on the word by a non-interactive shell; an interactive shell may perform it, but shall do so only when the expansion would result in one word.
$ dash
$ echo foo > *
$ ls
'*' README.md ...
$ bash
$ echo bar >> *
bash: *: ambiguous redirect
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
@tatsu Redirecting to a file glob withbash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you usebash
orsh
).
– Kusalananda♦
11 hours ago
1
This is a much better answer as it explains the underlying reason why the behaviour ofsh
(actuallydash
in this case) differs from that ofbash
.
– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);
);
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%2funix.stackexchange.com%2fquestions%2f531001%2fwildcards-not-interpreted-by-shell-script-when-used-with-output-redirection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
i believe it is because the ?
wildcard is a bash feature, not shell (sh).
Try running
gnome-terminal --tab --active --title="script2" -- bash script2.sh
When you run ./script1.sh
it defaults to using bash
as instructed on the 1st line. However, when you run sh script2.sh
you use the shell to interpret the commands, and it ignores the recommendation from the 1st line.
New contributor
the?
is and always was ash
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.
– Uncle Billy
41 mins ago
add a comment |
i believe it is because the ?
wildcard is a bash feature, not shell (sh).
Try running
gnome-terminal --tab --active --title="script2" -- bash script2.sh
When you run ./script1.sh
it defaults to using bash
as instructed on the 1st line. However, when you run sh script2.sh
you use the shell to interpret the commands, and it ignores the recommendation from the 1st line.
New contributor
the?
is and always was ash
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.
– Uncle Billy
41 mins ago
add a comment |
i believe it is because the ?
wildcard is a bash feature, not shell (sh).
Try running
gnome-terminal --tab --active --title="script2" -- bash script2.sh
When you run ./script1.sh
it defaults to using bash
as instructed on the 1st line. However, when you run sh script2.sh
you use the shell to interpret the commands, and it ignores the recommendation from the 1st line.
New contributor
i believe it is because the ?
wildcard is a bash feature, not shell (sh).
Try running
gnome-terminal --tab --active --title="script2" -- bash script2.sh
When you run ./script1.sh
it defaults to using bash
as instructed on the 1st line. However, when you run sh script2.sh
you use the shell to interpret the commands, and it ignores the recommendation from the 1st line.
New contributor
edited 12 hours ago
New contributor
answered 13 hours ago
AlexLossAlexLoss
542 bronze badges
542 bronze badges
New contributor
New contributor
the?
is and always was ash
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.
– Uncle Billy
41 mins ago
add a comment |
the?
is and always was ash
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.
– Uncle Billy
41 mins ago
the
?
is and always was a sh
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.– Uncle Billy
41 mins ago
the
?
is and always was a sh
feature. It's a bash and only bash feature to expand globs (any globs) in redirections, as explained in the other answer. This answer is wrong and should be deleted.– Uncle Billy
41 mins ago
add a comment |
The bash manual has this to say in the 3.6 Redirections section:
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word splitting. If it expands to more than one word, Bash reports an error.
sh
does not do that: from the POSIX shell specification
If the redirection operator is "
<<
" or "<<-
", [...]. For the other redirection operators, the word that follows the redirection operator shall be subjected to tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion shall not be performed on the word by a non-interactive shell; an interactive shell may perform it, but shall do so only when the expansion would result in one word.
$ dash
$ echo foo > *
$ ls
'*' README.md ...
$ bash
$ echo bar >> *
bash: *: ambiguous redirect
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
@tatsu Redirecting to a file glob withbash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you usebash
orsh
).
– Kusalananda♦
11 hours ago
1
This is a much better answer as it explains the underlying reason why the behaviour ofsh
(actuallydash
in this case) differs from that ofbash
.
– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
add a comment |
The bash manual has this to say in the 3.6 Redirections section:
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word splitting. If it expands to more than one word, Bash reports an error.
sh
does not do that: from the POSIX shell specification
If the redirection operator is "
<<
" or "<<-
", [...]. For the other redirection operators, the word that follows the redirection operator shall be subjected to tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion shall not be performed on the word by a non-interactive shell; an interactive shell may perform it, but shall do so only when the expansion would result in one word.
$ dash
$ echo foo > *
$ ls
'*' README.md ...
$ bash
$ echo bar >> *
bash: *: ambiguous redirect
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
@tatsu Redirecting to a file glob withbash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you usebash
orsh
).
– Kusalananda♦
11 hours ago
1
This is a much better answer as it explains the underlying reason why the behaviour ofsh
(actuallydash
in this case) differs from that ofbash
.
– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
add a comment |
The bash manual has this to say in the 3.6 Redirections section:
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word splitting. If it expands to more than one word, Bash reports an error.
sh
does not do that: from the POSIX shell specification
If the redirection operator is "
<<
" or "<<-
", [...]. For the other redirection operators, the word that follows the redirection operator shall be subjected to tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion shall not be performed on the word by a non-interactive shell; an interactive shell may perform it, but shall do so only when the expansion would result in one word.
$ dash
$ echo foo > *
$ ls
'*' README.md ...
$ bash
$ echo bar >> *
bash: *: ambiguous redirect
The bash manual has this to say in the 3.6 Redirections section:
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, filename expansion, and word splitting. If it expands to more than one word, Bash reports an error.
sh
does not do that: from the POSIX shell specification
If the redirection operator is "
<<
" or "<<-
", [...]. For the other redirection operators, the word that follows the redirection operator shall be subjected to tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion shall not be performed on the word by a non-interactive shell; an interactive shell may perform it, but shall do so only when the expansion would result in one word.
$ dash
$ echo foo > *
$ ls
'*' README.md ...
$ bash
$ echo bar >> *
bash: *: ambiguous redirect
edited 11 hours ago
community wiki
2 revs
glenn jackman
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
@tatsu Redirecting to a file glob withbash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you usebash
orsh
).
– Kusalananda♦
11 hours ago
1
This is a much better answer as it explains the underlying reason why the behaviour ofsh
(actuallydash
in this case) differs from that ofbash
.
– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
add a comment |
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
@tatsu Redirecting to a file glob withbash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you usebash
orsh
).
– Kusalananda♦
11 hours ago
1
This is a much better answer as it explains the underlying reason why the behaviour ofsh
(actuallydash
in this case) differs from that ofbash
.
– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
thank you! much clearer. although I had no particular use for sh if bash could accomplish the same. I just forgot about bash. do you think sh is more appropriate here?
– tatsu
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
Why are you putting wildcards on the RHS of a redirection? Why don't you already know the filename? What if there are more than one matching file?
– glenn jackman
11 hours ago
1
1
@tatsu Redirecting to a file glob with
bash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you use bash
or sh
).– Kusalananda♦
11 hours ago
@tatsu Redirecting to a file glob with
bash
is only appropriate if you know that the glob will expand to a single file, always. Ideally, you should hand the correct filename to the script on the command line instead (in which case it does not matter if you use bash
or sh
).– Kusalananda♦
11 hours ago
1
1
This is a much better answer as it explains the underlying reason why the behaviour of
sh
(actually dash
in this case) differs from that of bash
.– Anthony Geoghegan
11 hours ago
This is a much better answer as it explains the underlying reason why the behaviour of
sh
(actually dash
in this case) differs from that of bash
.– Anthony Geoghegan
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
actually I just wanted to know why that wasn't working, it was bugging me, but of course the parent script knows the full name and can pass that as a variable, which (of course) is more robust, I guess being in the middle of testing something and lazyness got the better of me but now I'll probably pass it as a variable.
– tatsu
11 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f531001%2fwildcards-not-interpreted-by-shell-script-when-used-with-output-redirection%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
Upvoted because the question is clear and reproducible -- and I learned something new about the differences in how POSIX-compliant shells behave.
– Anthony Geoghegan
59 mins ago