0

I'm working with multiple scripts at a time, all in diferent languages and I'm tired of typing python3 main.py for python scripts and sh main.sh for shell

Not even mentioning c.

Basically something like this.

run main.py
run main.sh
run main.c
ikenas
  • 103

1 Answers1

1

I think you can create a file something like run.sh. Open with text editor and place your command to run this files in terminal like below example:

python main.py
gcc main.c
./main.sh

Depending on which source file to compile and run place the code in that run file. Then open properties and check for executable permissions. You can do this using terminal by this command

sudo chmod +rwx run file

Then open terminal and execute the run file as

./run file name

Commands in run file will be executed sequentially.

Pranu Pranav
  • 349
  • 1
  • 3
  • 11
  • 1
    yes... but i could have a lot of files or create one just to test something... in that case i would be doing more work... thank you anyway – ikenas Nov 14 '20 at 20:30
  • Then create another c or python program which creates run.sh file based on the run command of each files. – Pranu Pranav Nov 16 '20 at 15:20
  • 1
    Read the file name. If it has extension .c then write gcc file name.c to the run file. same way for c++ python other src files. – Pranu Pranav Nov 22 '20 at 05:48