I have a scenario where I need to start a python script in a new terminal. This script takes (waits for) user input at various steps in its execution. I want to automate it and provide all the sequence of inputs in a file. I tried the following but it doesn't work.
$ cat commands.txt
1\r
2\r
3\r
$ cat test.sh
#!/bin/bash
gnome-terminal -- python3 test.py 1<commands.txt
Can anyone please guide me on how to do this correctly ? I'm also not sure if using '\r' to separate each input in my commands.txt file is the right approach.