[linux] Print Array Values Each Line In Bash Shell
- Purpose
- Split String by delimiter and save them to array. Then print each values.
- Solution
-
string=“word1,word2,word3” array=(${string//,/ }) # Split using comma as delimiter for element in “${array[@]}”; do echo “$element” done
-