|
|
useless use of cat!
Both ways do the same thing and of course omitting a "useless" `cat` would be more efficient, but assuming you will be repeating the command several times with different search strings, it's much easier to arrow back from the end of the line only a few characters, rather than all the way through the filename, especially if the filename is a hundred or so characters long when the path is included. eg:
In that example, the second line only requires pressing the up arrow key once, the left arrow key once, then typing the string 'for'. The other way, `grep 'somethingtosearch' some_long_file_name.txt` would require arrowing all the way back through the file name, or else doing ctrl-a and arrowing all the way forward through the search string. So, really, the usage of `cat` in the original example does have a good use under certain circumstances.
useless use of cat!
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|