Issue
I have some string like
1;2;3;4;5
I want to be able to iterate over this string taking each word one by one. For the first iteration to take 1 the next to take 2 and the last 5.
I want to have something like this
for i in $(myVar)
do
echo $i
done
but I do not know how to fill the myvar
Solution
echo '1;2;3;4;5' | tr \; \\n | while read line ; do echo $line; done
Answered By - Costi Ciudatu Answer Checked By - David Goodson (WPSolving Volunteer)