- We implementing as below code using for loop but wrong output coming after running the script.
- But using a shell loop to process text is often the wrong way to go.
Now as an answer to the question in the title, for a shell with for loops taking more than one variables, you’ve got zsh (you seem to already be using zsh syntax by not quoting your variables or not disabling globbing when splitting command substitution):
Or the shorter form:
The equivalent with POSIX shells: