Skip to main content
10 events
when toggle format what by license comment
Apr 21, 2022 at 15:09 comment added Rubem Pacelli You are right, my answer was wrong, now I fixed it. Thank you for your explanation. Yes, my answer does diverge a bit from the actual answer...
Apr 21, 2022 at 15:07 history edited Rubem Pacelli CC BY-SA 4.0
fixing the answer
Apr 21, 2022 at 15:03 comment added Kusalananda The question is, "So why shell can't interpret the following line" (followed by shell code containing a syntax error). One could answer that question and then possibly add more info about brace expansions. {A1..A5} is not a brace expansion because there is no sequence of letters or numbers filling the range between the two strings A1 and A5 (try, e.g. echo {A1..A5} as opposed to echo {1..5}).
Apr 21, 2022 at 14:58 comment added Rubem Pacelli @Kusalananda How does this not address the actual question if I showed how to iterate through a loop in the shell? About using space instead braces in the first example, you are right, the braces are optional. About calling {A1..A5} brace expansion, I think your statement is wrong, William Shoots mention that "The brace expression itself may contain either a comma-separated list of strings or a range of integers or single characters.". So {A1..A5} is called brace expansion, indeed.
Apr 21, 2022 at 14:41 review Late answers
Apr 21, 2022 at 19:15
Apr 21, 2022 at 14:27 history edited Rubem Pacelli CC BY-SA 4.0
improve answer
Apr 21, 2022 at 14:27 comment added Kusalananda Note that the brace expansion in the first example is not needed (could have used a simple whitespace-delimited list) and that the brace expansion in the third example is not a brace expansion at all in bash (that loop iterates over the single string {A1..A5}). The answer also does not address the actual issue in the question (there's an error in the code).
Apr 21, 2022 at 14:27 history edited Rubem Pacelli CC BY-SA 4.0
improve answer
S Apr 21, 2022 at 14:21 review First answers
Apr 22, 2022 at 8:38
S Apr 21, 2022 at 14:21 history answered Rubem Pacelli CC BY-SA 4.0