Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to concatenate stdin in to a pipe?

Tags:

bash

shell

I want to send the output of a pipe and stdin to a pipe in bash.

I.e:

gen_input | cat - | parse_input_and_stdin

would send the output of gen_input to parse_input_and_stdin and then leave stdin open for more interactive input.

like image 256
Alex Reece Avatar asked Mar 29 '12 05:03

Alex Reece


2 Answers

Close.

{ gen_input ; cat ; } | parse_input_and_stdin
like image 81
Ignacio Vazquez-Abrams Avatar answered Oct 12 '22 23:10

Ignacio Vazquez-Abrams


cat <(gen_input) - | parse_input_and_stdin
like image 39
ams Avatar answered Oct 13 '22 00:10

ams