0

For example I have 6 digit number 234566, I have to read all the numbers digit by digit like

output

2

3

4

5

6

6

I tried this

read a #reads a six digit number 
j=1
n=1
while [ $n -le 6 ]
do
    for j in $a
    do
       echo $j
    done
    j=$((j+1))
    n=$((n+1))
done

but its giving the same number 6 times.

0 Answers0