$ cat foo
foo
bar
Now if I do:
$ some_program foo
It's working.
But if I try:
$ cat foo | some_program
It's not working.
I'm looking for a clean way to pipe input to some_program
without having to use messy temporary files.
bashcommand linepipezsh
$ cat foo
foo
bar
Now if I do:
$ some_program foo
It's working.
But if I try:
$ cat foo | some_program
It's not working.
I'm looking for a clean way to pipe input to some_program
without having to use messy temporary files.
Best Answer
Piping will put
cat foo
's stdout tosome_program
's stdin. In this casesome_program
is expecting an argument, not stdin, so you'll want to storecat foo
's result into a variable and then callsome_program $variable
.I'm not too sure on bash scripting, but try this?
Actually, maybe this will work...