Timeline for Why is printf better than echo?
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 21, 2020 at 12:37 | comment | added | Olivier Dulac |
I'd include this printf exemple: printf "*** Backup shell script ***\n\nRuntime: %s @ %s\n\n" "$(date)" "$(hostname)" # ie, the same display as the echo line above
|
|
| May 13, 2018 at 11:31 | history | edited | GAD3R | CC BY-SA 4.0 |
added 2 characters in body
|
| Apr 29, 2013 at 15:22 | comment | added | Keith Thompson |
Using echo to print a variable can fail if the value of the variable contains meta-characters.
|
|
| Feb 23, 2013 at 19:24 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 |
added missing quotes
|
| Feb 22, 2013 at 20:18 | history | edited | NlightNFotis | CC BY-SA 3.0 |
edited body
|
| Feb 22, 2013 at 20:13 | history | answered | NlightNFotis | CC BY-SA 3.0 |