Syntax and Headline Order

DavidLamabuer
2017-05-30 13:12:58 +02:00
parent 7bcc65178a
commit 65660ca25e

@@ -1,6 +1,6 @@
#Double quote to prevent globbing and word splitting.
# Double quote to prevent globbing and word splitting.
### Problematic code:
## Problematic code:
```sh
echo $1
@@ -8,13 +8,13 @@ for i in $*; do :; done # this one and the next one also applies to expanding ar
for i in $@; do :; done
```
### Correct code:
## Correct code:
```sh
echo "$1"
for i in "$@"; do :; done # or, 'for i; do'
```
### Rationale
## Rationale
The first code looks like "print the first argument". It's actually "Split the first argument by IFS (spaces, tabs and line feeds). Expand each of them as if it was a glob. Join all the resulting strings and filenames with spaces. Print the result."