Issue
I'm having problems when creating a shell wrapper script to be able to run a python file through my terminal. I'm using this as my wrapper:
#!/usr/bin/env python3
python3 -u index.py "$@"
And I get this error:
File "/mnt/c/Users/...", line 2
python3 -u index.py "$@"
^^^^^
SyntaxError: invalid syntax
I have granted permissions to both the wrapper and the python file with the following commands:
chmod +x dag
chmod u+x index.py
I'm trying to do all of this in Windows, in case that is important. And I have python installed and in my PATH so that it's recognized. Any idea?
Solution
I think your shebang line is wrong.
It should probably read #!/usr/bin/env bash
or similar.
Else the script is executed using the python interpreter instead of the shell.
Answered By - Raphael Answer Checked By - Clifford M. (WPSolving Volunteer)