Reputation: 21
I can't figure out why the script isn't working, I don't get any syntax error, It just does nothing and delete the files
#!/bin/bash
recorddir="${1:-/var/spool/asterisk/mp3/}"
cd $recorddir;
for file in *.wav; do
mp3=$(basename "$file" .wav).mp3;
lame V3 "$file" "$mp3";
mv "$mp3" /var/spool/asterisk/rec;
rm -f "$file";
done
Upvotes: 0
Views: 876
Reputation: 34145
You're missing -
in front of V3
for sure. Otherwise, this is just a very messy script. If there's something more that doesn't work:
do
in this script)set -eu
Upvotes: 1