More generic version of the UNIX pipe