Consider this setup and folder structure:
c:\foo
\bin\foo.bat
\lib\foo.py
I have foo.bat path added to my environment PATH, so I can call it from anywhere passing in some arguments:
c:/>foo.bat -v
foo.bat contains this code:
@ECHO OFF
"c:\foo\lib\foo.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
This works fine in Windows.
Now I want to be able to do the same in Mac or Linux.
How can I create this executable file, that will call the script lib\foo.py, passing in some arguments?
thanks
[SOLUTION]
thanks guys, your answers helped me end up with this script that works as intended:
in \foo\bin\foo file
#!/usr/bin/env bash
python /usr/local/foo/lib/foo.py $*