I need to insert a space between 2 strings. I used many techniques and all of them worked but when I assign the value to another variable then the inserted space vanishes, strange! Please advise.
# dat=`date |awk '{print $2,$3}'`
# echo $dat
Nov 3
The above is perfectly fine. Now
# echo ${dat}|sed "s/ / /g"
Nov 3
#
The above also is perfectly fine. Now if I assign the same output to another variable the extra space vanished.