From 65660ca25ef07089c179edcd409abb94e30ec1fe Mon Sep 17 00:00:00 2001 From: DavidLamabuer Date: Tue, 30 May 2017 13:12:58 +0200 Subject: [PATCH] Syntax and Headline Order --- SC2086.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SC2086.md b/SC2086.md index 7a6790b..a9634e7 100644 --- a/SC2086.md +++ b/SC2086.md @@ -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."