I have a bash script
bash.sh that looks like this:
#!/usr/bin/env bash /usr/local/sbin/pythonScript.py firstArgument secondArgument
If I call the pythonScript.py from my terminal with the two command line arguments it asks me the question
" Do you really want to accept this arguments ? ( yes / no )" and I have to type yes or no and press enter in the terminal in order to resume the script execution.
Now I want that my
bash.sh script is doing the
yes answer for me but I have no clue how.
I tried something like this in my script
#!/usr/bin/env bash echo "yes\n" | /usr/local/sbin/pythonScript.py firstArgument secondArgument
Can anyone help me how to provide dynamic command line arguments to a python script and also simulate the ENTER key press.
The python script is reading from
On Unix, the prompt is written to the file-like object stream. stream defaults to the controlling terminal (/dev/tty)