Skip to content

Commit

Permalink
Minor changes in the script!
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashkrishna07 authored and Animeshz committed Oct 2, 2023
1 parent a2e8dba commit 6aa1acc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
### 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%.*}
file="$1";
no_extension="${file%.*}"
if [[ "$file" == *.cpp || "$file" == *.c ]];
then
make $no_extension
./$no_extension
make "$no_extension"
./"$no_extension"
elif [[ "$file" == *.java ]];
then
javac $file;
java $no_extension;
javac "$file";
java "$no_extension";
elif [[ "$file" == *.py ]];
then
python $file;
python "$file";
elif [[ "$file" == *.sh ]];
then
bash $file;
bash "$file";
else
echo "Unable to compile this file format!";
fi

0 comments on commit 6aa1acc

Please sign in to comment.