I'm trying to write a script that renames the subtitles to the same name as the movie file is.
I'm currently stuck at getting the .srt filename into a variable. Currently I'm seeking the smallest file in the directory with:
srtnametmp="$(basename $(find . -name '*.srt' -maxdepth 1 -type f -printf "%s\t%p\n" | sort -n -r| tail -1 | awk '{print $NF}'))"
However, it can be more than one .srt in the same directory, so I was thinking about finding the newest .srt (by creation time). Now I've been searching for 5-ish hours, tested several solutions, but I never got the result (only the filename) stuck to the variable $srtnametmp Now I'm little lost and looking for help.