(Untitled)

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

cityofspheres February 7 2011, 08:44:07 UTC
it's been so long...

Reply

hmaon February 7 2011, 09:41:52 UTC
huh?

Reply


Leave a comment

Up