Skip to content

Instantly share code, notes, and snippets.

@dandye
Last active December 30, 2021 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dandye/9b30244dbae43d960b667235f77467b4 to your computer and use it in GitHub Desktop.
Save dandye/9b30244dbae43d960b667235f77467b4 to your computer and use it in GitHub Desktop.
make target to quickly find and update shebangs
update_shebangs:
grep -m1 -r -l '^#!.*python' venv/bin/ | while read -r filename; do \
echo "$${filename}"; \
head -n1 "$${filename}"; \
sed -i -e '1 s|^#!.*python|#!/opt/rh/rh-python38/root/bin/python|' "$${filename}"; \
head -n1 "$${filename}"; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment