From 19a6c3b72d1286c68eb8b1901c0c955eb063983b Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Fri, 18 Sep 2015 21:54:51 -0400 Subject: [PATCH] Updated SC2002 (markdown) --- SC2002.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SC2002.md b/SC2002.md index 5921fba..945da56 100644 --- a/SC2002.md +++ b/SC2002.md @@ -4,13 +4,14 @@ ```sh cat file | tr ' ' _ | grep a_ +cat file | ( while read i; do echo "${i%?}"; done ) ``` ### Correct code: ```sh -tr ' ' _ < file | grep a_ -< file tr ' ' _ | grep a_ # **simple commands only, won't work with compounds +< file tr ' ' _ | grep a_ # **simple commands only, won't work with compounds +( while read i; do echo "${i%?}"; done ) < file # postfix works for everything ``` ### Rationale: