I'm having trouble manipulating strings in bash. I wish to re-write extensions.
I have the following 2 files in a Downloads directory
- Example 001.mkv
- Example 002.mkv
Using the script below I always get the same filenames returned without .mkv rewritten into .mp4.
find /Downloads -name \*.mkv -execdir echo $(file={}; echo ${file/mkv/mp4};) \;
I understand this isn't all you need to re-format a file but this script is part of a larger script that is passed to FFMPEG.
Here is the full command with FFMPEG.
find /Downloads -name \*.mkv -execdir ffmpeg -i {} -vcodec copy -acodec copy $(file={}; echo ${file/mkv/mp4};) \;