Newer
Older
#!/bin/sh
CXXFLAGS="-std=c++11 -Wall -Wno-sign-compare -Wno-unused-value"
Nicolas M. Thiéry
committed
usage () {
echo compile-and-run [program.cpp]
echo
echo Compiles and executes a c++ program.
echo The standard input and output is passed down to the program.
echo The exit status is that of the compiler.
}
if [ x"$1" = "x" ]; then
usage
exit 0
fi
Nicolas M. Thiéry
committed
if g++ $CXXFLAGS $1; then
./a.out
else
exit $?
fi