Created
October 16, 2014 16:01
-
-
Save ushu/4d8e164661cea8bd946f to your computer and use it in GitHub Desktop.
Run a given program against an input
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/bash | |
cd /code | |
if [ -e code.c ]; then | |
gcc -o runner code.c || exit 1 | |
cat input | runner | |
elif [ -e code.cpp ]; then | |
cat input | runner | |
elif [ -e code.rb ]; then | |
cat input | ruby code.rb | |
elif [ -e code.py ]; then | |
cat input | python code.py | |
else | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment