Answer the question
In order to leave comments, you need to log in
How to carry out enumeration?
#!/bin/bash
echo "Start"
for file in `find test/*/*.png`
do
convert $file $file.gif
done
echo "Finish"
Answer the question
In order to leave comments, you need to log in
$ find ./test -type f -name '*.png' -exec convert {} {}.gif \;
#!/bin/bash
set -e
for dirs in $(find ./test -type d -name 'images'); do
for dir in "${dirs}"; do
imgs=$(find "${dir}" -type f -name '*.jpg' -o -name '*.jpeg' -o -name '*.png')
cat ${imgs} > "${dir}"/$$.gif;
done
done
./test
├── 1
│ └── images
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ └── 4898.gif
├── 2
│ └── images
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ └── 4898.gif
├── 3
│ └── images
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ └── 4898.gif
└── images
├── 1.jpg
├── 2.jpg
├── 3.jpg
└── 4898.gif
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question