I have several python scripts that I want to execute for a random number of executions. So I had the idea of creating a bash shell script that receives two arguments (1st is the number of executions, 2nd is the python script).
Problem is, if I execute the python script on the shell prompt directly, it’s fine. But if I execute via the bash shell script…it works but there are some odd messages.
The bash script is as follows
#!/bin/bash
for x in $(eval echo {1..$1}); do $(python3 $2.py); done
However the output looks like this after passing in “4” as the first parameter
./roll.sh: line 2: <Output 1>: command not found
./roll.sh: line 2: <Output 2>: command not found
./roll.sh: line 2: <Output 3>: command not found
./roll.sh: line 2: <Output 4>: command not found
Where is the “Command not found” coming from? Any ideas?