Skip to content

Instantly share code, notes, and snippets.

@eddieh
Last active December 11, 2019 05:30
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 eddieh/a6ade1fbb953f46caaa582b77776395e to your computer and use it in GitHub Desktop.
Save eddieh/a6ade1fbb953f46caaa582b77776395e to your computer and use it in GitHub Desktop.
Insert shebang #! with Emacs
#!/usr/bin/tail -n+2
Don't chmod that file! Don't type a shebang! Edit an executable script
in Emacs and invoke
M-x executable-set-magic
This is a self-displaying file made with `executable-self-display'. If
you have had a stroke and forgotten how to make a script executable by
hand, just insert the following form as the first line of the script
#!/path/to/shell [optional-argument]
Then change the mode of the script
chmod u+x script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment