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;








2















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.sh



  • script2.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.










share|improve this question
























  • 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

















2















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.sh



  • script2.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.










share|improve this question
























  • 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













2












2








2


1






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.sh



  • script2.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.










share|improve this question
















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.sh



  • script2.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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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










2 Answers
2






active

oldest

votes


















2














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.






share|improve this answer










New contributor



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



















  • 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


















7














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





share|improve this answer

























  • 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 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





    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













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
);



);













draft saved

draft discarded


















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









2














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.






share|improve this answer










New contributor



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



















  • 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















2














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.






share|improve this answer










New contributor



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



















  • 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













2












2








2







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.






share|improve this answer










New contributor



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









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.







share|improve this answer










New contributor



AlexLoss 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 answer



share|improve this answer








edited 12 hours ago





















New contributor



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








answered 13 hours ago









AlexLossAlexLoss

542 bronze badges




542 bronze badges




New contributor



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




New contributor




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














  • 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
















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













7














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





share|improve this answer

























  • 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 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





    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















7














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





share|improve this answer

























  • 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 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





    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













7












7








7







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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








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 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





    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

















  • 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 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





    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
















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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單