How to split an expression by space in bash?Split single string into character array using ONLY bashMoving...

Does it make sense to occupy open space?

Does the United States guarantee any unique freedoms?

How quickly could a country build a tall concrete wall around a city?

French equivalent of "Make leaps and bounds"

Capacitors with a "/" on schematic

How do I get the =LEFT function in excel, to also take the number zero as the first number?

How to change output voltage using the LM7805?

Should I self-publish my novella on Amazon or try my luck getting publishers?

Why should public servants be apolitical?

In the movie Harry Potter and the Order or the Phoenix, why didn't Mr. Filch succeed to open the Room of Requirement if it's what he needed?

Is it allowed and safe to carry a passenger / non-pilot in the front seat of a small general aviation airplane?

Half-rock- half-forest-gnome

Why are the inside diameters of some pipe larger than the stated size?

What does Fisher mean by this quote?

Would the Elder Wand have been able to destroy a Horcrux?

Team goes to lunch frequently, I do intermittent fasting but still want to socialize

Can ads on a page read my password?

Erratic behavior by an internal employee against an external employee

What word can be used to describe a bug in a movie?

Does the length of a password for Wi-Fi affect speed?

Unexpected route on a flight from USA to Europe

WordCloud: do not eliminate duplicates

How can I make Ubuntu run well (including with wifi) on a 32-bit machine?

How do I say "Outdoor Pre-show"



How to split an expression by space in bash?


Split single string into character array using ONLY bashMoving from bash to zsh: PATH resetBASH and Carriage Return BehaviorHow to split command's output and assigns result to an array using only a single expression?“while read -r LINE; do” is replacing multiple spaces with a single spaceZsh bad substitution error in zshrcHow to disable word splitting during command substitution?Bash script: parse subdirectory and not current directoriesSplit string by space in ZSHhow can I split a string into indevidual characters in an array using bash?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am getting the valid result I want in zsh but not bash, what am I missing? I am trying to split the string into words.



Bash



bash-3.2$ echo ${$(echo "Hello World")[@]}
bash: ${$(echo "Hello World")[@]}: bad substitution


zshrc



> echo ${$(echo "Hello World")[@]}
Hello World









share|improve this question

























  • Bash doesn't have nested substitution. Please provide a more realistic usecase.

    – muru
    4 mins ago


















0















I am getting the valid result I want in zsh but not bash, what am I missing? I am trying to split the string into words.



Bash



bash-3.2$ echo ${$(echo "Hello World")[@]}
bash: ${$(echo "Hello World")[@]}: bad substitution


zshrc



> echo ${$(echo "Hello World")[@]}
Hello World









share|improve this question

























  • Bash doesn't have nested substitution. Please provide a more realistic usecase.

    – muru
    4 mins ago














0












0








0








I am getting the valid result I want in zsh but not bash, what am I missing? I am trying to split the string into words.



Bash



bash-3.2$ echo ${$(echo "Hello World")[@]}
bash: ${$(echo "Hello World")[@]}: bad substitution


zshrc



> echo ${$(echo "Hello World")[@]}
Hello World









share|improve this question














I am getting the valid result I want in zsh but not bash, what am I missing? I am trying to split the string into words.



Bash



bash-3.2$ echo ${$(echo "Hello World")[@]}
bash: ${$(echo "Hello World")[@]}: bad substitution


zshrc



> echo ${$(echo "Hello World")[@]}
Hello World






bash zsh






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 10 mins ago









user2167582user2167582

1375 bronze badges




1375 bronze badges
















  • Bash doesn't have nested substitution. Please provide a more realistic usecase.

    – muru
    4 mins ago



















  • Bash doesn't have nested substitution. Please provide a more realistic usecase.

    – muru
    4 mins ago

















Bash doesn't have nested substitution. Please provide a more realistic usecase.

– muru
4 mins ago





Bash doesn't have nested substitution. Please provide a more realistic usecase.

– muru
4 mins ago










0






active

oldest

votes














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%2f534648%2fhow-to-split-an-expression-by-space-in-bash%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f534648%2fhow-to-split-an-expression-by-space-in-bash%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

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...