0

I'm very new to bash and I'm trying to run script in python I have. When the script runs, the first thing it prompt is y/n question, and I would like to automate this part so I can run it automatically without this part.

Based on this post, I have tried to autofill it with the following script:

(.venv) reut@whatever:~/git/my_amazing_script$ echo -e "y\ny\ny\ny"; for year in $(seq 20
17 1 2020) ;do python3 ./my_nice_script.py -start_year $year  -end_year $year ;done

>>>

y y y y

Will process with the following parametersstart_year=2017, end_year=2017, Please confirm [y/n].

As it can be seen, when it runs, it prints first all the y and then prompt again the y/n question.

I would like my script to run and autofill the y/n so I don't need to type and it can iterate. How can I do that?

Reut
  • 101

0 Answers0