4 ms·
Why add the extra cat command? grep -i 'problem' /var/log/syslog
by melling 12y ago
Why add the extra cat command?
grep -i 'problem' /var/log/syslog
- coriny 12y agoHe's after this weeks "Useless use of cat" award: http://www.smallo.ruhr.de/award.html#cat http://www.smallo.ruhr.de/award.html#cat Good to see there's still some competitors out there.
- zem 12y agopipelines read better left to right
- Hello71 12y ago</var/log/syslog grep -i 'problem'
- stonogo 12y agobecause invariably you're going to want to recall this command from history and insert "grep -v HostnameIDontCareAbout" between the cat and the grep. or you're going to want to replace "grep -i 'problem'" with "awk '/problem/ { print $3 }". or you're going to want to do both. people whine about 'useless use of cat' like it's still 1982, but the fact is that it's convenient for iterative development of a pipeline in situ and it costs nothing.