I am trying to write a shell script that takes files from a cd drive and moves them onto an external USB drive. I am running it on windows 11 in the git shell for windows.
Part of the script is to change the .CDA files from the cd drive to a .mp3 file and I have not been able to get this to work.
This is the best answer I found but it does not work:
ffmpeg -i *.cda *.mp3
This Is the rest of my script if it helps
cd /d/
mkdir $1
cd /e/
cp *.cda /d/$1
cd /d/$1
ffmpeg -i *.cda *.mp3
ls
You can do this simply using a for loop and variable substitutions to extract the filename without extension. See below the
help forrelevant output.You loop code:
Here the
%~nfwill use the filename, without extension, in the variablefand you can append your extension