From cd3beb0e8d115dabe069260b4dd4a3f6a0fd26c1 Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 31 Dec 2016 13:37:39 -0800 Subject: [PATCH] Updated SC2202 (markdown) --- SC2202.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SC2202.md b/SC2202.md index dc63e6f..cab6db3 100644 --- a/SC2202.md +++ b/SC2202.md @@ -22,9 +22,9 @@ done Globs in `[ ]` will expand to a sequence of words, one per matching filename. Meanwhile, operators work on single words. -The problematic code is equivalent to `[ current.log -nt backup/file1.log backup/file2.log backup/file3.log ]`, which is invalid syntax. +The problematic code is equivalent to `[ current.log -nt backup/file1.log backup/file2.log backup/file3.log ]`, which is invalid syntax. A typical error message is `bash: [: too many arguments` or `dash: somefile: unexpected operator`. -Instead, you can iterate over the filenames you want with a loop, and apply your condition to each filename. +Instead, use a `for` loop to iterate over matching filenames, and apply your condition to each. ### Exceptions: