r/shittyprogramming • u/fofz1776 • Mar 31 '22
How do I 69 two programs?
I want to foo | bar and bar | foo at the same time.
54
Upvotes
r/shittyprogramming • u/fofz1776 • Mar 31 '22
I want to foo | bar and bar | foo at the same time.
27
u/rgnkn Mar 31 '22
The professional advanced way would be:
Take two computers!
foo | barin a shell of computer A.bar | fooin a shell of computer B.Now, press within the very same Planck time frame the enter key on both computers.
Alternatively - if it doesn't need to be concurrent:
19
u/stone_henge Mar 31 '22 edited Mar 31 '22
let the lovemaking commence
11
u/Tai9ch Mar 31 '22
This is pretty simple on a POSIX system.
Write a C program and, in the initial process:
In process P:
In process Q:
And that's it. You've got pair of programs doing a circular human centipede.
6
u/[deleted] Mar 31 '22
https://man.openbsd.org/pipe.2
2
u/ThaiJohnnyDepp Apr 01 '22
Now THIS is the kind of content I subscribed to this sub for!