Timeline for Bash: Storing command result in variable messes up output
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 8, 2024 at 10:37 | comment | added | Paul_Pedant |
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.
|
|
| Mar 8, 2024 at 10:36 | answer | added | binaryBigInt | timeline score: 1 | |
| Mar 8, 2024 at 10:11 | comment | added | binaryBigInt |
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
|
|
| Mar 8, 2024 at 10:07 | comment | added | Kusalananda♦ | 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)? | |
| Mar 8, 2024 at 10:04 | history | asked | binaryBigInt | CC BY-SA 4.0 |