iteration

Shell script - iterate over space separated words/characters (in zsh)

不打扰是莪最后的温柔 提交于 2020-08-25 03:50:49
问题 I am having some trouble figuring out how to iterate over space separated words/characters in a shell script. For instance I would like to iterate over a variable containing the characters in the alphabet separated by a space. NOTE: The result should be the same even if the alphabet variable contained space separated strings instead of characters, i.e "aa bb cc ..." instead of "a b c .." I have tried a lot of the alternatives provided from: How to split a line into words separated by one or

Shell script - iterate over space separated words/characters (in zsh)

送分小仙女□ 提交于 2020-08-25 03:48:09
问题 I am having some trouble figuring out how to iterate over space separated words/characters in a shell script. For instance I would like to iterate over a variable containing the characters in the alphabet separated by a space. NOTE: The result should be the same even if the alphabet variable contained space separated strings instead of characters, i.e "aa bb cc ..." instead of "a b c .." I have tried a lot of the alternatives provided from: How to split a line into words separated by one or