bash passing String to command, awaiting user input

I am trying to pass a string to command which waits for input to be entered on command line, I need to automate the user input process, luckily the string is static it wont change, I can hardcode it. Things I have tried so far

  1. echo "hardcoded string" | /tmp/command
  2. /tmp/command < hardcoded.txt

It still it asks input, i cannot use expect or autoexpect.

1 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like