Update 'echo -n' example

Putting `echo -n` in backticks isn't a productive example, since command
substitution (backticks, or `$()` in Bash) already removes the trailing
newline(s).

References:
* <https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html>
* <http://heirloom.sourceforge.net/sh/sh.1.html#4>
This commit is contained in:
Kevin Ernst 2022-05-12 21:57:34 -04:00 committed by GitHub
parent a59c8598b0
commit 51b64c1433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2590,7 +2590,9 @@ printf 'hello world\n%.0s' {1..5}
```
##### Do not echo the trailing newline
```bash
username=`echo -n "bashoneliner"`
echo -n "Doing the things... "
# (do things)
echo "done."
```
##### Copy a file to multiple files (e.g copy fileA to file(B-D))