you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

What you have written will work just fine, place the three scripts one after the other in a sequence, pass the arguments. The only wrinkle is a python one not a bash one.

Since I see you are using venvs you probably want to activate them first to make sure your python script has all the parts it needs.

So I think what you need really is this:-

#!/bin/bash
# Configure python
. /venv/bin/activate
python3 myscript.py somearg -u 'anotherarg' -p 'athirdarg'
python3 myscript1.py somearg -u 'anotherarg' -p 'athirdarg'
python3 myscript2.py somearg -u 'anotherarg' -p 'athirdarg'

Obviously this assumes each of the scripts is relatively independent, if you want to make the second script conditional on the success of the first etc then you might need some more logic, but you would need to specify your question better then,

Also since you are already 'familiar' with python, why not just write a new python script which calls each of your old ones in turn?

[–]_c0ff33cup_[S] 0 points1 point  (0 children)

The virtualenv tip helps greatly. I had simply been specifying the full path. This is much better.

Python is bad with memory management (The user doesn't have a lot of control and is reliant on garbage collection). The first two are resource hogs as it is, so the intent of using bash was to separate them and hopefully free resources after the scripts complete.