adding spaces for a variable value

Hi,

i have to form the header and add fillers(spaces) to it.

I have done something like this. i have added 10 spaces at the end

HDR="AAAABBBBCCNN "
echo $HDR >> file1.dat

but the spaces are not being stored in the file. How to add the spaces.

Put double quotes around the variable:

echo "$HDR" >> file1.dat

Thanks a lot. This solved my problem.