From f24c71fe52c412b673a99a8733e755cffee402a6 Mon Sep 17 00:00:00 2001 From: koalaman Date: Fri, 4 Sep 2015 08:30:12 -0700 Subject: [PATCH] Created SC2008 (markdown) --- SC2008.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 SC2008.md diff --git a/SC2008.md b/SC2008.md new file mode 100644 index 0000000..9f85142 --- /dev/null +++ b/SC2008.md @@ -0,0 +1,19 @@ +## echo doesn't read from stdin, are you sure you should be piping to it? + +### Problematic code: + + find . | echo + +### Correct code: + + find . + +### Rationale: + +You are piping command output to `echo`, but `echo` ignores all piped input. + +In particular, `echo` is not responsible for putting output on screen. Commands already output data, and with no further actions that will end up on screen. + +### Exceptions: + +None. \ No newline at end of file