How should I loop through all chars in a string.
My pseudocode
stringVar="abcde"
for var in stringvar
{
do some things with var
}
result i need
a
b
c
d
I want to loop all the vars but i can only get it to work with a whitespace splitted var like
stringVar="a b c"
for var in stringVar; do
echo $var
done;
result
a
b
c
but i cant do it for a string that isnt split with whitespaces.
The question is flagged as duplicate but not one of the answers (with upvotes) is available in the linked questions..