$ cat foo foo bar
Now if I do:
$ some_program foo
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.
Piping will put
I'm not too sure on bash scripting, but try this?
Actually, maybe this will work...
Besides the way @Bob proposed, there is another, more flexible method:
You could use
which is basically equivalent of
If the program is expecting only one argument at a time, you can do
There are many other options to
In bash you can use process substitution
You can add as much parameters as you like this way as long you know that these parameters will be file names that will be read only. You can't read and write at the same time.