Feb 04, 2011 23:22
Stupid shell trick to change a C source file into a script:
#!/bin/bash
#if 0
out=/tmp/a.${RANDOM}${RANDOM}.out
tail -n +2 $0 | gcc -O2 -x c -o $out -
chmod +x $out
$out
rm $out
exit
#endif
(just insert it at the beginning of the file)
Leave a comment
Comments 2
Reply
Reply
Leave a comment