Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I prefer cat-then-pipe while using shell interactively. It's easier to add things to the middle of the pipeline. You simply move the cursor the pipe character, and type another command.

Original:

  cat error.log | grep 'ERROR:' | wc -l
After change:

  cat error.log | grep -v 'SENSITIVE' | grep 'ERROR:' | wc -l
But with cat-less version, you have to think and sometimes even move things around.

Original:

  grep error.log 'ERROR:' | wc -l
After change:

  grep -v 'SENSITIVE' error.log | grep 'ERROR:' | wc -l
Moreover, some commands behave differently in cat-less mode. For example, gzip:

  gzip file.js | wc -c # oops, we've just removed file.js
  cat file.js | gzip | wc -c # shows compressed size


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: