From 8ca2852356c9b9725432e719669fccd1e33761e9 Mon Sep 17 00:00:00 2001 From: rasbt Date: Wed, 21 May 2014 19:20:06 -0400 Subject: [PATCH] syntax fix --- useful_scripts/prepend_python_shebang.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/useful_scripts/prepend_python_shebang.sh b/useful_scripts/prepend_python_shebang.sh index edabd69..3bbc937 100644 --- a/useful_scripts/prepend_python_shebang.sh +++ b/useful_scripts/prepend_python_shebang.sh @@ -1,20 +1,20 @@ # Sebastian Raschka 05/21/2014 # 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 # so that script files can be executed via # >> myscript.py # instead of # >> 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\ -#!'"$(which python)"' +#!/usr/bin/env python ' {} \; # removes temporary files find . -name "*.bak" -exec rm -rf {} \; # makes Python scripts executable -chmod ug+x *.py \ No newline at end of file +chmod ug+x *.py