Skip to content

Instantly share code, notes, and snippets.

@SnoringFrog
Last active March 30, 2017 10:24
Show Gist options
  • Save SnoringFrog/b5003bc9d985dfbd900e to your computer and use it in GitHub Desktop.
Save SnoringFrog/b5003bc9d985dfbd900e to your computer and use it in GitHub Desktop.
Stupid Shebang Tricks - Various stupid things you can do by using the shebang to select unconventional interpreters.
Various stupid things you can do by using the shebang to select unconventional interpreters.
#!/usr/bin/env touch
This file just touches itself when you try to make it do anything.
#!/usr/bin/env cat
Prints its own contents when executed; ergo, it is always a quine. Could also be done with less/more/dog.
This one could be slightly useful in some situations (small documentation files and readmes?)
#!/usr/bin/env echo
This just prints its name whenever it's called.
#!/usr/bin/env yes
This just prints its name endlessly whenever it's called.
#!/usr/bin/env rm
This file deletes itself if you run it
In other words, it dies if you execute it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment