I have two python scrips (direct.py and nat.py) and I would like to make a bash script to select which python to start based on my input.
Also, when manually running those py scripts I have input options (0...8,h and q). When press 'q' I have sys.exit().
eg:
./start.sh and output should be something like:
Chose your mode: (if type nat)
python3 nat.py
now python script is displayed and if press q, back to bash to chose option.
echo
the options, useread
to get input and useswitch case
depends on input. – Siva Oct 23 '18 at 08:42read
andswitch case
in an infinitewhile
loop? If needed, you would then probably need atrap
to catchctrl-c
properly: https://unix.stackexchange.com/questions/42287/terminating-an-infinite-loop – Gohu Oct 23 '18 at 09:39