Skip to main content
The \n isn't the problem, only the \r needs to be removed. There is no need for eval here.
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

The problem was that this command added a \r\n\r, it before the final \n. It can be removed via:

WINDOWS_USER=$(eval "whoamiwhoami.exe"exe | tr -d "\r\n"'\r')

The problem was that this command added a \r\n, it can be removed via:

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")

The problem was that this command added a \r before the final \n. It can be removed via:

WINDOWS_USER=$(whoami.exe | tr -d '\r')
Minor formatting improvement
Source Link
AdminBee
  • 23.6k
  • 25
  • 55
  • 77

The problem was that this command added a "\r\n"\r\n, it can be removed via:

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")

The problem was that this command added a "\r\n", it can be removed via:

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")

The problem was that this command added a \r\n, it can be removed via:

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")
Source Link

The problem was that this command added a "\r\n", it can be removed via:

WINDOWS_USER=$(eval "whoami.exe" | tr -d "\r\n")