What is correct syntax to for loop variable in PATH? - LinuxHow to do indirect variable evaluationPATH...

Three phase systems - are there any single phase devices that are connected between two phases instead of between one phase and neutral?

Redirection operator, standard input and command parameters

Conditional statement in a function for PS1 are not re-evalutated

Manager is asking me to eat breakfast from now on

What is the origin of "Wonder begets wisdom?"

What does "play in traffic" mean?

Is this guy trying to scam me?

Inscriptio Labyrinthica

Will a ThunderBolt 3 (USB-C?) to ThunderBolt 2 cable allow me to use a MacBook Pro as second monitor?

Killing a star safely

Why should fork() have been designed to return a file descriptor?

Do I have to mention my main characters age?

Why didn't Balak request Bilam to bless his own people?

Linux ext4 restore file and directory access rights after bad backup/restore

What does a Nintendo Game Boy do when turned on without a game cartridge inserted?

Satellite in orbit in front of and behind the Moon

What's the difference between 1kb(64x16) and 1kb(128x8) for EEPROM memory size?

What is the minimum wait before I may I re-enter the USA after a 90 day visit on the Visa B-2 Program?

What's a German word for »Sandbagger«?

Ethiopian Airlines tickets seem to always have the same price regardless of the proximity of the date?

Why is there an extra "t" in Lemmatization?

Aren't all schwa sounds literally /ø/?

Can two waves interfere head on?

Where can I find standards for statistical acronyms and whether they should be capitalized or lower case?



What is correct syntax to for loop variable in PATH? - Linux


How to do indirect variable evaluationPATH environment variable in linuxEnvironment Variable: PATHFor loop brackets - C like syntax$PATH variable for CRON in OpenSuseCorrect syntax for inputting date variable into date calculation codebash for loop variable not changingIP Packet sniffer/filter/manipulator using TUN interfaceWhat exactly is the PATH variable for and why do you amend bashrc?Variable not incrementing in for loopfor loop variable assignment with whitespaces






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







0















I have to execute following loop:



root1=path/to/root1
root2=path/to/root2
for i in {1..2}; do ${root${i}}; done


It, of course, doesn't work and i can't seem to figure solution for such scenario.
Admin suggested thread brought solutions that doesn't lead to result i seek, e.g.



for i in {1..2}; do $root$i; done


Which prints the correct path identifier, not path it represents.










share|improve this question









New contributor



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




















  • Possible duplicate of How to do indirect variable evaluation

    – muru
    26 mins ago


















0















I have to execute following loop:



root1=path/to/root1
root2=path/to/root2
for i in {1..2}; do ${root${i}}; done


It, of course, doesn't work and i can't seem to figure solution for such scenario.
Admin suggested thread brought solutions that doesn't lead to result i seek, e.g.



for i in {1..2}; do $root$i; done


Which prints the correct path identifier, not path it represents.










share|improve this question









New contributor



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




















  • Possible duplicate of How to do indirect variable evaluation

    – muru
    26 mins ago














0












0








0








I have to execute following loop:



root1=path/to/root1
root2=path/to/root2
for i in {1..2}; do ${root${i}}; done


It, of course, doesn't work and i can't seem to figure solution for such scenario.
Admin suggested thread brought solutions that doesn't lead to result i seek, e.g.



for i in {1..2}; do $root$i; done


Which prints the correct path identifier, not path it represents.










share|improve this question









New contributor



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











I have to execute following loop:



root1=path/to/root1
root2=path/to/root2
for i in {1..2}; do ${root${i}}; done


It, of course, doesn't work and i can't seem to figure solution for such scenario.
Admin suggested thread brought solutions that doesn't lead to result i seek, e.g.



for i in {1..2}; do $root$i; done


Which prints the correct path identifier, not path it represents.







linux path for






share|improve this question









New contributor



juststuck 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



juststuck 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 17 mins ago







juststuck













New contributor



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








asked 41 mins ago









juststuckjuststuck

11 bronze badge




11 bronze badge




New contributor



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




New contributor




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















  • Possible duplicate of How to do indirect variable evaluation

    – muru
    26 mins ago



















  • Possible duplicate of How to do indirect variable evaluation

    – muru
    26 mins ago

















Possible duplicate of How to do indirect variable evaluation

– muru
26 mins ago





Possible duplicate of How to do indirect variable evaluation

– muru
26 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
});


}
});






juststuck 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%2funix.stackexchange.com%2fquestions%2f531364%2fwhat-is-correct-syntax-to-for-loop-variable-in-path-linux%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








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










draft saved

draft discarded


















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













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












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
















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%2f531364%2fwhat-is-correct-syntax-to-for-loop-variable-in-path-linux%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

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...