Is there a way to simulate ENTER key in a bash script imputing values to a code through a here-document (EOF). Readily possible in bash, see question 6264596.
Pseudo code:
#!/bin/bash
code_executable << EOF
value1
value2
EOF
value2
needs to be followed by a carriage return, ie ENTER when executing from a shell.
Thanks guys.
Simulation of executable running on a terminal:
$./code_executable
>Do you want to continue? yes or no
User: y
>Enter number:
User: 314
If User doesn't press ENTER on keyboard after entering 314, executable hangs/halts there and waits.
Edit: see exceptions in stdin buffering that prevent the EOF from passing arguments to an executable as illustrated by @that other guy answer below.