Thanks for answers. I also had some kind of problem. Moving .nzb.queued files to .nzb files. There were spaces and other cracks in the file names, and this solved my problem:
find . -type f -name "*.nzb.queued" | sed -ne "s/^\(\(.*\).nzb.queued\)$/mv -v \"\1\" \"\2.nzb\"/p" | sh
It is based on the answer of Diomidis Spinellis.
The regular expression creates one group for the entire file name and one group for the part before .nzb.queued, and then creates a shell move command. With quoted strings. It also avoids creating a loop in the shell script, as sed has already done so.
Jerry Jacobs Oct 30 '14 at 8:53 2014-10-30 08:53
source share