I am in WSL and I try to get the windows username:
#!/bin/bash
WINDOWS_USER=$("whoami.exe")
echo "Windows username: '${WINDOWS_USER}'"
but the output is kinda scrambled:
$ ./createNewUser.sh
'indows username: 'intra\user
I actually expected the output Windows username: 'intra\user'. But the last ' is moved to the start of the sentence - how can this happen?
LFat the end of each linewhoami.exe, not the script.intra\user<CR>sends the following'back to over-write the first column. Check it withprintf '%s' "${WINDOWS_USER}" | od -t x1ac.