I am new to shell scripting. so kindly bear with me if my doubt is too silly.
I have png images in 2 different directories and an executable which takes an images f
If you are depending on the two directories to match up based on a locale sorted order (like your attempt), then an array should work.
im1_files=(~/prev1/*.png) im2_files=(~/prev3/*.png) for ((i=0;i<=${#im1_files[@]};i++)); do run_black.sh "${im1_files[i]}" "${im2_files[i]}" done