Preserve spaces while reading character character

Hi All,

I am trying to read a file character by character,

#!/bin/bash
while read -n1 char; do
echo -e  "$char\c"
done  < /home/shak/testprogram/words
Newyork       is a very  good city.
Newyorkisaverygoodcityforliving

I need to preserve the spaces as thats an important requirement.

especially multiple spaces.

Thanks for your help guys,this is an amazing place to be for newbies

I have searched this forum but I dint find a similar question

Regards
kingcobra

while IFS="" read -r -n1 char

does the trick.
BTW echo -e and echo -n are not portable, better get used to printf :

printf "%c" "$char"

or

printf "$char"

use printf "%c" "$char"
printf "$char" will break if there is "%" character read.

Indeed this a lovely place to be.

Thanks MadeinGermany and rdrtx1 you guys are wonderful.