Below is a command I use to merge multiple .wav files into a single file named output.wav
:
ffmpeg -f concat -safe 0 -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) output.wav
This works as expected but when I add it to a script named merge-into-one.sh
with permission :
-rwxrwxrwx 1 ddsasd staff 93 26 Dec 11:50 merge-into-one.sh
and then execute using ./merge-into-one.sh
I receive error :
./merge-into-one.sh
./merge-into-one.sh: line 1: syntax error near unexpected token `('
./merge-into-one.sh: line 1: `ffmpeg -f concat -safe 0 -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) output.wav'
Have I created the .sh
executable correctly ?