Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created October 6, 2012 23:48
Show Gist options
  • Save duckinator/3846535 to your computer and use it in GitHub Desktop.
Save duckinator/3846535 to your computer and use it in GitHub Desktop.
#!./test.sh -std=c99 -ggdb -I. -DDEBUG
#include <stdio.h>
int main() {
puts("tada!");
}
#!/bin/bash
FILENAME=${@:${#@}:1} # Last argument
REST=${@:1:$[${#@}-1]} # Everything except the last argument
file=".tmp-$(date +'%s').c"
tail -n +2 $FILENAME > $file
gcc $REST $file
rm $file
./a.out
rm a.out
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment