How can I run a program in bash in such a way that first it receives some input from a file, and then, as the file ends, it will receive input from terminal?
1 Answer
cat myfile - | program
or
cat myfile /dev/stdin | program
Use
echo
, which has the same end result:(echo "someinput"; cat) | program
somecommand <<< "someinput"
?