Live data from Hacker News

The Beauty of Unix Pipelines

prithu.xyz

381–388 of 388 posts

Re: The Beauty of Unix Pipelines

#381

I have problems understanding what commands I can pipe. Some work some don't.

The commands that read their input from standard input could be used as receiver in a pipeline. For instance: `A | B` is a short form of `A > tmp.txt; B There are some commands that need literal arguments which is different than standard input. For instance the echo command. `echo < list.txt` will not work assuming you want to print the items inside the list. `echo itemA itemB itemC` will work. This is where xargs co…

How do you know which ones receive input from standard input or how can you find out efficiently?

Re: The Beauty of Unix Pipelines

#382
post #325

Earlier quoted context omitted.

> It hasn't aged very well, either. "Even today, the X server turns fast computers into dumb terminals" hasn't been true for at least a couple of decades... You're not wrong, but that's only because people wrote extensions for direct access to the graphics hardware... which obviously don't work remotely, and so aren't really in the spirit of X. It's great that that was possible, but OTOH it probably delayed the inven…

Fair enough! I wasn't really thinking of the remote use case which was indeed X's main use case when it was conceived (and which is not very relevant today for the majority of users). In any case, this was just an example. The Handbook is peppered with complaints which haven't been relevant for ages. It was written before Linux got user-friendly UIs and was widespread to almost every appliance on Earth. It was writte…

Oh, certainly. It was really just a nitpick :).

Re: The Beauty of Unix Pipelines

#383

Earlier quoted context omitted.

No, that is totally accurate - there is nothing even close to PowerShell. You were inaccurate on the other hand - what is similar to PowerShell ?

Structured object piping, for one. What is this thread about again? Oh right, piping.

"Structured object piping" is not a product.

Re: The Beauty of Unix Pipelines

#384
Pipes are like one of the best experiences you’ll have whatever you were doing. I was debugging a remote server logging millions of Logs a day and was aggregating a little on the server. Then all it required was wget, jq, sed and awk. And I had a powerful log analyzer than splunk or any other similar solution on a developer Mac. Which you think is awesome when you’re paying a fortune to use Splunk. And for getting some insights quick, Unix pipes are a godsend.

Re: The Beauty of Unix Pipelines

#385

Earlier quoted context omitted.

The commands that read their input from standard input could be used as receiver in a pipeline. For instance: `A | B` is a short form of `A > tmp.txt; B There are some commands that need literal arguments which is different than standard input. For instance the echo command. `echo < list.txt` will not work assuming you want to print the items inside the list. `echo itemA itemB itemC` will work. This is where xargs co…

How do you know which ones receive input from standard input or how can you find out efficiently?

The man page of the command helps in most cases. Often the description section has info if the command reads from standard input, a file or both.

Re: The Beauty of Unix Pipelines

#386

Earlier quoted context omitted.

Structured object piping, for one. What is this thread about again? Oh right, piping.

"Structured object piping" is not a product.

That's some non-sequitur argument you got there.

Re: The Beauty of Unix Pipelines

#387
post #147

Earlier quoted context omitted.

> As in Unix signals? tbh those seem ugly too; sigwinch, sighup, etc ought to be connected to stdin in some way; it'd be nice if there were a more general way to send arbitrary data to processes as an event Well, as the process can arbitrarily change which stdin it is connected to, as stdin is a file, you need some way to still issue directions to that process. However, for the general case, your terminal probably su…

Sure, I mean more like there'd be some interface ByteStream, and probably another interface TerminalInput extends ByteStream; TerminalInput would then contain the especially terminal-related signals (e.g. sigwinch). If a program doesn't declare that it wants a full TerminalInput for stdin, the sigwinches would be dropped. If it declares it wants one but the environment can't provide one (e.g. stdin is closed, stdin i…

I have written something on this topic previously: http://blog.rfox.eu/en/Programmers_critique_of_missing_struc...

Re: The Beauty of Unix Pipelines

#388

Earlier quoted context omitted.

You should take a stroll in the real world sometime, where spaces and Unicode exists :)

The parent comment is extreme, and the real world is indeed very diverse, but I would also be quite surprised to find a software project with spaces in internal filenames.

So would I, but the world is, thankfully, not entirely composed of software projects.
Post reply on HN