例1,for循环遍历文件:
复制代码 代码示例:
#!/bin/sh
for i in `ls`
do
echo $i;
cwebp -q 85 $i -o "../bb/"$i;
done
例2,for循环遍历文件并计数:
复制代码 代码示例:
#!/bin/sh
num = 0;
for i in `ls`
do
let num=${num}+1;
echo $i" "$num;
# cwebp -q 85 $i -o "../aa/"$num".jpg";
cp $i "../aa/"$num".jpg";
done