Explain this shell script code.

Hi i am new to shell script can any one please explain me the code below which is written for execution of python scripts which are located in same folder.
please explain the code line by line

ls  *.py > xx
while [ 1 ]
do
read myline || break
python $myline 
done<xx

Thanks
Mukthyar.
:wall:

listing the python scripts and redirecting the filenames to a file "xx"
then executing the python scripts with the while loop one by one till the last file ..
After the while loop will quit ..

---------- Post updated at 11:56 AM ---------- Previous update was at 11:49 AM ----------

alternate code ..

$ for i in *.py; do python $i; done
1 Like