X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/blobdiff_plain/72b08995e64930bc56f38fa83b0062bc8715306d..ad03eb635da06d362480a2bd4125283ef077885c:/programming/gccrun diff --git a/programming/gccrun b/programming/gccrun index 55e6b68..5241931 100755 --- a/programming/gccrun +++ b/programming/gccrun @@ -18,6 +18,8 @@ cat > "$f/command.c" << EOF #include #include #include +#include +#include #include #include #include @@ -28,15 +30,16 @@ cat > "$f/command.c" << EOF int main(int argc, char *argv[], char *envp[]) { - $@; + $1; return 0; } EOF -if ! gcc -o "$f/command" "$f/command.c"; then +shift +if ! gcc -o "$f/command" "$f/command.c" $@; then exit 1 fi if [ -n "$wrapper" ]; then - "$wrapper" "$f/command" + $wrapper "$f/command" else "$f/command" fi