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"' __ {} \;
精彩评论