diff --git a/main/run b/main/run new file mode 100755 index 0000000..85874dc --- /dev/null +++ b/main/run @@ -0,0 +1,24 @@ +#!/bin/bash + +### No need to memorize numerous commands for executing and compiling code in various programming languages. +### Just provide the programming file as an argument to this script. + +file="$1"; +no_extension="${file%.*}" +if [[ "$file" == *.cpp || "$file" == *.c ]]; +then + make "$no_extension" + ./"$no_extension" +elif [[ "$file" == *.java ]]; +then + javac "$file"; + java "$no_extension"; +elif [[ "$file" == *.py ]]; +then + python "$file"; +elif [[ "$file" == *.sh ]]; +then + bash "$file"; +else + echo "Unable to compile this file format!"; +fi