Hacker Newsnew | comments | show | ask | jobs | submit login

cat will actually launch a separate process, while redirection will not. Unless you're working on a very old machine or a low-spec embedded system, this shouldn't make much practical difference.

"< some-file.txt | wc -l" doesn't work for me. "< some-file.txt wc -l" does. I actually wasn't aware of the latter syntax; and now that I think about it, I'm actually not sure if I've ever used redirection in combination with piped commands.

(I don't do a whole lot of shell scripting, and I exclusively used DOS, Windows, and OS/2 during my most formative years, so my reflex is to reach for an actual programming language to do nontrivial things, because even though I've been using Linux for years as my main OS, the fact that I now have a competent shell available still hasn't completely sunk in. I was amazed when I discovered the xargs command and its --max-procs option; I'd written a Python script to do much the same thing.)




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: