How to create and run a batch program

WolverineGator

Golden Member
Mar 20, 2001
1,011
0
0
I want to run a program called "runall" which does the following:

#!/bin/bash

python 'prog1.py'
python 'prog2.py'

The programs take a long time and need to run in sequence. I set the permissions to executable (-rwxrw-r--), but it won't run. I get: "-bash: runall: command not found"

How do I do it?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The current directory isn't in your PATH like it is in Windows. So either run it like esun says or put it in a directory that is in your path.
 

WolverineGator

Golden Member
Mar 20, 2001
1,011
0
0
That was it:

./runall &

And I modified the script with nohup like this: nohup python 'prog1.py'

Thank you.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
screen is a better option than nohup IMO, you can start programs under screen and know that they'll not get killed when you logout but you can also reattach to the screen session later on.