samedi 2 octobre 2021

Make a list of all files in two folders then iterate through the combined list randomly

I have two directories with photos that I want to manipulate to output a random order of the files each time a script is run. How would I create such a list?

d1=/home/Photos/*.jpg
d2=/mnt/JillsPC/home/Photos/*.jpg

# somehow make a combined list, files = d1 + d2
# somehow randomise the file order
# during execution of the for;do;done loop, no file should be repeated

for f in $files; do
    echo $f   # full path to each file
done



Aucun commentaire:

Enregistrer un commentaire