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?
somecommand <<< "someinput"
cat myfile - | program
cat myfile /dev/stdin | program
Use echo, which has the same end result:
(echo "someinput"; cat) | program
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3 years ago