mirror of
https://github.com/rasbt/python_reference.git
synced 2024-12-18 08:10:24 +00:00
autodetect python version
This commit is contained in:
parent
80fb307f24
commit
f71bcde1b3
|
@ -8,8 +8,10 @@
|
||||||
# >> python myscript.py
|
# >> python myscript.py
|
||||||
|
|
||||||
# prepends !#/usr/bin/python to all .py files
|
# prepends !#/usr/bin/python to all .py files
|
||||||
|
|
||||||
|
python_ver=$(which python)
|
||||||
find ./ -maxdepth 1 -name "*.py" -exec sed -i.bak '1i\
|
find ./ -maxdepth 1 -name "*.py" -exec sed -i.bak '1i\
|
||||||
#!/usr/bin/env/python
|
#!/usr/bin/env/python"$python_ver"
|
||||||
' {} \;
|
' {} \;
|
||||||
|
|
||||||
# removes temporary files
|
# removes temporary files
|
||||||
|
|
Loading…
Reference in New Issue
Block a user