I have a folder with multiple .wav files that I am trying to concatenate in order but I think that I am too inexperienced with bash commands to do this as efficient as possible. You see, I don't know how to use a files content as input for a command:
I get all the file names in correct order with:
ls *.wav | sort -V > script
Script:
ep1-s1.wav
ep2-s1.wav
ep3-s1.wav
I add ' \' after each line to use in the command
lam script -s " \\" > script2
Script2:
ep1-s1.wav \
ep2-s1.wav \
ep3-s1.wav \
I delete the last ' \':
sed '$ s/.$//' script2 > script3
Script3:
ep1-s1.wav \
ep2-s1.wav \
ep3-s1.wav
And now I want to use the content of that file for the sox
, like:
sox ep1-s1.wav \
ep2-s1.wav \
ep3-s1.wav output.wav
How can I achieve this?
Now, there is probably a way to do this in one command, but I couldn't figure out how piping works like that: if you know how to, I would really love to know!
sox
. Could you give an example of the command you would like to run and we can help you build a script to generate that command? – David King May 21 '18 at 19:50sox ep1-s1.wav ep2-s1.wav ep3-s1.wav output.wav
but I want to create theep1-s1.wav ep2-s1.wav ep3-s1.wav
part dynamically, depending on the files in the directory and in order using:ls *.wav | sort -V > script
– Bart May 21 '18 at 20:05sox *wav
? Given your example filenames and normal Linux locale settings this would work. – m0dular May 21 '18 at 20:22