dear lazy web ... (UNIX pipes)

Ash Berlin ash_cpan at firemirror.com
Sat Apr 19 15:47:28 BST 2008


On 19 Apr 2008, at 15:40, Greg McCarroll wrote:

>
> So, I thought I knew how pipes worked from a distant OS class at uni.
>
> let say ...
>
>    process_that_generates_output | grep something
>
> now i thought that grep would be started around the same time as the
> first process and would grind through output when it had enough input
> to work on, and from this dim distant OS class I remember we
> implemented a special shared memory area in our own OS to do just
> that (this was 14 years ago).
>
> now today i wondered about,
>
>    process_that_generates_output | grep something | head
>

process_that_generates_output > dev/null

Will still run.

Think of the case where you only want the head of the output, but want  
the process to continue - nothing else is really sensible for general  
usage.




More information about the london.pm mailing list