String concatenation in Bash script

后端 未结 3 1388
灰色年华
灰色年华 2021-01-23 18:18

I am writing this Bash script:

count=0   
result

for d in `ls -1 $IMAGE_DIR | egrep \"jpg$\"`
do

    if (( (count % 4) == 0 )); then
                result=\"a         


        
3条回答
  •  一向
    一向 (楼主)
    2021-01-23 19:12

    Something like this?

    count=0   
    
    find $IMAGE_DIR -name "*.jpg" |
    while read f; do
            if (( (count % 4) == 0 )); then
                    result="abc $f"
    
                    if (( count > 0 )); then
                            echo $result
                    fi
    
            else
                    result="$result $d"
            fi
    
            (( count++ ))
    done
    

提交回复
热议问题