简体   繁体   中英

Append rm to a find statement

I Have the following 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.

您可以传递多个-exec开关来查找,如何:

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"' __ {} \;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM