I want to join several .mp3 files into one file. The files need to be sorted by modification time.
The command
Code:
ls -rt --quoting-style=shell-always
sorts how I need, and quotes the filenames with single quotes.
The command
Code:
cat file1.mp3 file2.mp3 file3.mp3 > one_file.mp3
joins files, generally speaking.
I can combine these into
Code:
cat $(ls -rt) > one_file.mp3
if using simple filenames.
The filenames I'm using though are UGLY and non-uniform, such as
' - --- some (words)- @www.xyz.com --.mp3'
so the command breaks down, and gives an error such as:
cat: unrecognized option '----'
The --quoting-style=shell-always seems not to make a difference in this context.
How could I make this work? A single command is preferable. A short script would be acceptable.
Other Information:
The files are created by recording streaming music. Some stations split songs up into several files, naming them automatically.