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

Oh I don't care: I do it all the time when I compose cli commands. But is it doing one thing, and doing it well, to use `cat – concatenate and print files` to open a file?

I think it's a good example of when it's worth straying from the philosophy.





> But is it doing one thing, and doing it well, to use `cat – concatenate and print files` to open a file?

Yes, it 'prints' the file to stdout which is consumed by the pipe and turned into the input for the next command in the pipeline. It doesn't matter whether you're only 'printing' a single file or a bunch of them.


And it numbers empty lines (-b) and non-empty lines (-n) and the end of lines (-E) and elides empty lines (-s) and search-and-replaces tabs (-T) and nonprinting characters (-v)



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

Search: