I assigned the windows' user name to a variable in WSL Ubuntu Bash with this command:
WINUSER=`cmd.exe /C 'echo %username%'`
If I echo the variable, it behaves normally:
$ echo $WINUSER
myusername
However, if I try to insert it into a string, every character I place AFTER the variable will replace the characters at the beginning of the string, like this:
echo "/mnt/c/User/$WINUSER/Documents"
/Documentsr/myusername
While, if I don't place characters after the strings:
echo "/mnt/c/User/$WINUSER"
/mnt/c/User/myusername
It prints correctly to stout, but I still can't cd /mnt/c/User/$WINUSER
Since it doesn't occur with other variables, such as $HOME, I guess it depends by the output of the windows-wsl inter-operability. How could I solve this?