Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Did you write the script using a Windows editor that saves its files as DOS text files (with an extra carriage-return at the end of each line, compared to Unix text files)? Commented Mar 8, 2024 at 10:07
  • I wrote the script using nano in a WSL shell. If I open the file in Notepad++ there is only a LF at the end of each line Commented Mar 8, 2024 at 10:11
  • 1
    The carriage-return is being output by whoami.exe, not the script. intra\user<CR> sends the following ' back to over-write the first column. Check it with printf '%s' "${WINDOWS_USER}" | od -t x1ac. Commented Mar 8, 2024 at 10:37