I have a little test.sh script that I run from the command line ./test.sh
and it will ask me for input to 2 questions that I enter, then it loops till I ctrl-c
out of it.
I want to write a little python script that can run my test.sh
, and enter the inputs to the script questions from variables, var1 and var2 that I set in python.
I also want to have another variable, var3, that loops for x long and runs my test.sh, and ends it then relaunches it every x minutes based on the value of var3
I wrote this code but it doesn't seem to pass the commands into my test.sh
after it launches:
import os
os.system('./test.sh arg1')
time.sleep(10)
sh('input answer 1')
time.sleep(5)
sh('input answer 2')
popen
– Basile Starynkevitch 1 hour agox
seconds orx
times? – J.F. Sebastian 1 hour ago