mirror of
https://github.com/xmengnet/the-art-of-command-line.git
synced 2024-12-24 10:06:28 +08:00
Rework formatting on one item.
This commit is contained in:
parent
f7c278fdb5
commit
62b98a5c9b
1 changed files with 2 additions and 3 deletions
|
@ -147,13 +147,12 @@ Notes:
|
||||||
diff /etc/hosts <(ssh somehost cat /etc/hosts)
|
diff /etc/hosts <(ssh somehost cat /etc/hosts)
|
||||||
```
|
```
|
||||||
|
|
||||||
- When writing scripts you may want to put all of your code in curly braces:
|
- When writing scripts you may want to put all of your code in curly braces. If the closing brace is missing, your script will be prevented from executing due to a syntax error. This makes sense when your script is going to be downloaded from the web, since it prevents partially downloaded scripts from executing:
|
||||||
```sh
|
```bash
|
||||||
{
|
{
|
||||||
# Your code here
|
# Your code here
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
If the closing brace is missing, your script will be prevented from executing due to a syntax error. This makes sense when your script is going to be downloaded from the web, since it prevents partially downloaded scripts from executing.
|
|
||||||
|
|
||||||
- Know about "here documents" in Bash, as in `cat <<EOF ...`.
|
- Know about "here documents" in Bash, as in `cat <<EOF ...`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue