My goal is to run a shell script on my Mac Terminal that passes command line arguments to a python script. I know how to do it on Windows:
Batch file (pythonScript.bat
):
@py.exe C:\path\to\my\pythonScript.py %*
@pause
The %* forwards any command line arguments entered after the batch filename to the Python script. So when I run pythonScript.bat from the command line...
C:\> pythonScript
...the arguments I enter after the batch filename (for example C:> pythonScript some arguments) are passed to the python script.
How can I do that on my Mac?
How can I complement my code so that any command line arguments are forwarded to the python script?
Shell script (pythonScript.command):
#!/usr/bin/env bash
python3 /path/to/my/pythonScript.py