Timeline for bash $(printf "%s\n") does not create multiline
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 17, 2022 at 11:15 | history | edited | ilkkachu | CC BY-SA 4.0 | added 102 characters in body |
| Jan 17, 2022 at 10:37 | comment | added | Stéphane Chazelas | Technically $(cmd) or the deprecated `cmd` form strip all trailing newline characters, and when those are unquoted in list context (such as in arguments to a simple command like echo), they are subject to split+glob, and the newline character happens to be in the default value of $IFS. So upon expansion (not parsing), the string will be split into separate arguments to echo and echo happens to print its arguments space-separated (and followed by one newline character). | |
| Jan 17, 2022 at 10:20 | history | edited | Walter A | CC BY-SA 4.0 | added 49 characters in body |
| Jun 1, 2016 at 17:48 | history | edited | Walter A | CC BY-SA 3.0 | added 45 characters in body |
| Feb 25, 2015 at 21:46 | comment | added | jthill | It's not echo doing it, the shell does wordsplitting after parameter expansion for command arguments. | |
| Feb 25, 2015 at 21:05 | history | answered | Walter A | CC BY-SA 3.0 |