Reply to post: Re: grep, sed & awk

In Search of Lost Time: GNU Grep 3.7 released with fix for 'extreme performance degradation'

William Towle
Boffin

Re: grep, sed & awk

> Cat, although being one of the first commands most people use (at least if you follow the traditional "learn" route - remember learn?), actually becomes a little redundant once you get to know redirection of I/O streams.

On natively-POSIX hosts this is true, but it's worth knowing otherwise that where you're stuck on Windows with "git bash" (MSYS) or cygwin for comfort, there are corner cases where cat (strictly speaking, "useless use of cat") is what Just Works.

In one particular example when I found I couldn't get a manually-edited diff back into a git repository directly with 'patch' recently (known problem with files suddenly having DOS newlines), in tandem with my file being in /var (evidently special in some way my google fu did not help in finding) I ended up doing `cat /var/tmp/foo | git apply -` to get what I wanted!

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon