Skip to content

Instantly share code, notes, and snippets.

@hpcx82
Created May 30, 2012 09:46
Show Gist options
  • Save hpcx82/2835182 to your computer and use it in GitHub Desktop.
Save hpcx82/2835182 to your computer and use it in GitHub Desktop.
Compile & Run C++/Java/Scala as a script language
export exe=`echo $1 | awk -F. '{print $1}'`
#make sure the g++ version is 47
g++ $1 -std=c++11 -o $exe
./$exe
export exe=`echo $1 | awk -F. '{print $1}'`
javac $1
java $exe
export exe=`echo $1 | awk -F. '{print $1}'`
scalac $1
scala $exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment