开发者

Append rm to a find statement

I Have the fo开发者_高级运维llowing script to HandBrake a folder

find "$TRANSCODEDIR"/* -type f -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".mp4 --preset="$PRESET"' __ {} \;

I want to be append to the end of this line a rm (remove) command so when Hanbrake is done with the file to delete it.


You can pass more than one -exec switch to find, how about:

find "$TRANSCODEDIR"/* -type f -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%.*}".mp4 --preset="$PRESET"' __ {} \; -exec rm {} \;


find .... -exec bash -c 'HandBrake .... --preset="$PRESET"; rm "$1"' __ {} \;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜