Skip to content

Instantly share code, notes, and snippets.

@Fishezzz
Last active June 1, 2023 20:31
Show Gist options
  • Save Fishezzz/ddcac09962b336432f4260b154c9d7c9 to your computer and use it in GitHub Desktop.
Save Fishezzz/ddcac09962b336432f4260b154c9d7c9 to your computer and use it in GitHub Desktop.
Bash Quine
# quine
f(){ printf "\x$(printf %x 39)"; }; p='f(){ printf "\x$(printf %x 39)"; }; p=; echo ${p::38}$(f)${p}$(f)${p:38}'; echo ${p::38}$(f)${p}$(f)${p:38}
# quine with text
f(){ printf "\x$(printf %x 39)"; }; p='f(){ printf "\x$(printf %x 39)"; }; p=; echo ${p::38}$(f)${p}$(f)${p:38}'; echo ${p::38}$(f)${p}$(f)${p:38} INSERT YOUR TEXT HERE!
# shorter quine
f(){ printf %b \\u0027; }; p='f(){ printf %b \\u005C; }; p=; echo ${p::29}$(f)${p}$(f)${p:29}'; echo ${p::29}$(f)${p}$(f)${p:29}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment