I have a string and want to print each character line by line.
Input:
str="Hello World"
Expected Output:
H
e
l
l
o
W
o
r
l
d
I tried below script, got different output
#!/bin/bash
txt="Hello World"
for i in ${txt[*]}
do
echo $i
done
My output:
Hello
World