Created
March 10, 2014 06:31
-
-
Save jamesliu96/9460400 to your computer and use it in GitHub Desktop.
A simple Shell script output my name by compiling the BrainFuck script as C source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo '>++++++++[<+++++++++>-]<++.>++++[<++++++>-]<-.++++++++++++.--------.++++++++++++++.>+++++++++[<--------->-]<--.>++++++[<+++++++>-]<++.>+++++[<++++++>-]<-.++++++++++++.>++++++++++[<----------->-]<+++.' | sed ' | |
s/\([-+]\)/\1\1*p;/g | |
s/</p--;/g | |
s/>/p++;/g | |
s/>/p++;/g | |
s/\./putchar(*p);/g | |
s/\[/while(*p){/g | |
s/\]/}/g | |
1s/^/main(){char*p=calloc(1,6);/ | |
$s/$/}/ | |
/./!d'|gcc -xc - 2>/dev/null&&./a.out&&rm -f a.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment