Hacker News new | ask | show | jobs
by a3w 8 days ago
cat ~/.ssh/id_rsa | pbcopy

feels wrong. Unnecessary uses of cat.

`pbcopy < ~/.ssh/id_rsa`

3 comments

I stopped fighting this war because the Cat version sort of follows the Subject-Verb-Object order in English, depending on how you think about the subject.
The redirected input file can be moved before the command name, which improves the syntax for pipes.
This feels better, to have data flow from left to right, just like regular pipelines:

`<~/.ssh/id_rsa pbcopy`

   cat /a/thing
ok it looks right, let's continue

   cat /a/thing | thing doer
HN: "noooo you're doing it wrooong, use my obscure syntaaax that reads baaadlyy"
"reads badly" is subjective. How many processes your pipeline starts up is not.
yes, objectively it is "doesn't matter, it's interactive shell session", unless you're throwing around 5GB/s+ it doesn't matter, neither does few tens of KBs cat invocation would take
cat /a/thing

^-a Meta-d

thing doer /a/thing

(mostly snark I am a fan of unnecessary cats)