We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start this java program and provide "1" as input so that the server will perform respective operation.
The shell will feed the lines between the "EOF"s (can be any string, the ending string must be at the front of a line) to the command when it expects input.
Thanks Gary for the reply. However below solution did not work
java_command_you_want_to_feed_input_to <<EOF
1
EOF
Once shell script started releavant java command triggering and displaying options from 0-5 continuously in an infinite loop. I had stopped it forcefully with Ctrl-c