bash shell script two variables in for loop

前端 未结 7 1129
终归单人心
终归单人心 2020-12-09 19:33

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

相关标签:
7条回答
  • 2020-12-09 20:29

    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
    
    0 讨论(0)
提交回复
热议问题