Skip to main content
3 of 7
added 50 characters in body

Find files (ignoring extension) that may contain spaces, based on a supplied text file containing this list

So far, with my limited knowledge of Linux tools, I hit a wall. Because my list of files contains spaces, the "find" command fails to find any hits, but does not produce any errors. The reason for this script is to help with (re)transcoding of previously already transcoded files, such as music or movies.

searchdir="/volume2/" filename='list-in.txt' n=1 while read line; do echo "# $n : $line" FILES=${line%.*} find ${searchDir} -iname "$FILES.*" -type f n=$((n+1)) done < $filename 

I'm not sure where to go from here as awk or sed examples I found rarely deal with processing variables.

The input file would contain filenames in the form of:

Supertramp [The Very Best Of Supertramp] -05- Breakfast In America.m4a Supertramp [The Very Best Of Supertramp] -07- Take The Long Way Home.m4a Supertramp [The Very Best Of Supertramp] -09- Dreamer.m4a 

Not quote delimited, and no paths.