Newbie to bash here. I'm hoping to prepend a single whitespace to a variable in bash, currently I have the following, which doesn't seem to work:
space=`printf '%1s' ' '`
mystr='hello'
mystr="$space$mystr"
echo $mystr
So instead of printing out "hello", I would like the result to be " hello", which has an additional whitespace at the beginning. What's the correct way to do this? Thanks.