mirror of
https://github.com/rasbt/python_reference.git
synced 2025-02-17 13:58:13 +00:00
syntax fix
This commit is contained in:
parent
c031649455
commit
8ca2852356
|
@ -1,20 +1,20 @@
|
||||||
# Sebastian Raschka 05/21/2014
|
# Sebastian Raschka 05/21/2014
|
||||||
# Shell script that prepends a Python shebang
|
# Shell script that prepends a Python shebang
|
||||||
# e.g., `!#/usr/bin/python` to all
|
# '#!/usr/bin/env python' to all
|
||||||
# Python script files in the current directory
|
# Python script files in the current directory
|
||||||
# so that script files can be executed via
|
# so that script files can be executed via
|
||||||
# >> myscript.py
|
# >> myscript.py
|
||||||
# instead of
|
# instead of
|
||||||
# >> python myscript.py
|
# >> python myscript.py
|
||||||
|
|
||||||
# prepends e.g., !#/usr/bin/python to all .py files
|
# prepends '#!/usr/bin/env python' to all .py files
|
||||||
|
|
||||||
find ./ -maxdepth 1 -name "*.py" -exec sed -i.bak '1i\
|
find ./ -maxdepth 1 -name "*.py" -exec sed -i.bak '1i\
|
||||||
#!'"$(which python)"'
|
#!/usr/bin/env python
|
||||||
' {} \;
|
' {} \;
|
||||||
|
|
||||||
# removes temporary files
|
# removes temporary files
|
||||||
find . -name "*.bak" -exec rm -rf {} \;
|
find . -name "*.bak" -exec rm -rf {} \;
|
||||||
|
|
||||||
# makes Python scripts executable
|
# makes Python scripts executable
|
||||||
chmod ug+x *.py
|
chmod ug+x *.py
|
||||||
|
|
Loading…
Reference in New Issue
Block a user