开发者

Append rm to a find statement

开发者 https://www.devze.com 2023-02-17 23:27 出处:网络
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 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

精彩评论

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