My code:
#!/bin/bash
scriptspy =(
'/scs/sp1.py',
'/scs/sp2.py',
'/scs/sp3.py',
'/scs/sp4.py',
'/scs/spweb.py',
'/scs/sp11.py',
'/scs/spservice.py',
....
)
for i in scriptspy;
do python3.7 $i;
done
My goal is to run a list of files that have python within the directory and not need to run one by one.
individually would be python3.7 sp1.py
Obs: I can't execute all .py files in the directory, I need to pass a list to the loop with their name.
for i in ${scriptspy[@]}. Your current codefor i in scriptspyis iterating over a single string scriptspy.scriptspy=(/scs/sp1.py /scs/sp2.py /scs/sp3.py /scs/sp4.py).