0

I wrote a very simple bash script to try to input the word "password" into a program running in terminal.

./program
echo "password"

But when I run this script, "password" is printed after the program finishes running. How can I use the script to input "password" into the program immediately?

1 Answer 1

1

Sounds like a job for piping

echo "password" | ./program

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.