我想在几个文件上使用whiteboardCleaner.md脚本(https://gist.github.com/lelandbatey/8677901),所以我必须一次传递两个文件名,输入和输出文件。
脚本本身:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
通常我必须像
那样运行它./whiteboard input.jpg input-processed.jpg
但是如何将其循环到文件夹中的所有文件?
答案 0 :(得分:0)
#!/bin/bash
for file in *.jpg do
convert "$file" \
-morphology Convolve DoG:15,100,0 \
-negate \
-normalize \
-blur 0x1 \
-channel RBG \
-level 60%,91%,0.1 \
"${file}-processed"
done