Spaces in double quotes in variable ?

Hi got this issue and was wondering if someone could please help out ?

var='."          "'
echo $var
." "

I 'll get ." " and not ." with 10 spaces in between "

Thanks

Double quote "$var" .

1 Like

In the shell, in commands have $variables in "quotes", otherwise the shell will get its contents and break it into words (and even try a glob-match with each word).
The echo command:

echo "$var"
1 Like

DUHHHH!!!!!

Thanks for the prompt reply and help :wink:

All good