I have a binary (that I can't modify) and I can do:
./binary < file
I also can do:
./binary << EOF
> "line 1 of file"
> "line 2 of file"
...
> "last line of file"
> EOF
But
cat file | ./binary
gives me an error. I don't know why it doesn't work with a pipe. In all 3 cases the content of file is given to the standard input of binary (in different ways):
- bash reads the file and gives it to stdin of binary
- bash reads lines from stdin (until EOF) and gives it to stdin of binary
- cat reads and puts the lines of file to stdout, bash redirects them to stdin of binary
The binary shouldn't notice the difference between those 3 as far as I understood it. Can someone explain me, why the 3rd case doesn't work? Thank you!
BTW: The error given by the binary is
20170116/125624.689 - U3000011 Could not read script file '', error code '14'.
But my main question is, how is there a difference for any program with that 3 options.
cat
version? – Jeff Schaller 13 hours ago