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…
The Beauty of Unix Pipelines
381–388 of 388 posts
Re: The Beauty of Unix Pipelines
#382Earlier 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…
Re: The Beauty of Unix Pipelines
#383Earlier 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.
Re: The Beauty of Unix Pipelines
#384Re: The Beauty of Unix Pipelines
#385Earlier 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?
Re: The Beauty of Unix Pipelines
#386Re: The Beauty of Unix Pipelines
#387Earlier 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…
Re: The Beauty of Unix Pipelines
#388Earlier 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.