I want to start developing in c#, however I use Linux and VSCode for development and VSCode doesn't run the code due to some error that I can't find an answer to, so I decided with the help of this link (Run C# code on linux terminal) to make a bash script that does this part of the code:
mcs -out:hello.exe hello.cs
mono hello.exe
I made it like this so far:
#Trial
function cs_compiler(){
mcs -out:$2 $1
mono $2
}
It does work however I want to make it so that $2 (the second parameter) is automatically named after the $1(the first parameter), thus I needn't write $2's value and just write $1 create an exe with the same name and run that exe with mono. The second thing I want is to check if the exe form of the cs file already exists, if so just run it (mono) without doing mcs-out.
I'm sorry if this is of inconvenience, I'm new to stackoverflow and coding.