I'm trying to set artist information via variables with spaces in them. Lame craps out. Maybe I'm being retarded with bash?
#!/bin/bash
year=2008;
artist="New Kids On The Block";
album="The Block";
bitrate=320;
lame="lame -b $bitrate --ta \"$artist\" --tl \"$album\" --ty $year"
function first_half
{
for (( i=1;i<10;i++ )); do
$lame "track_0$i.wav" "track_0$i.mp3";
done;
}
function second_half
{
for (( x=10;x<18;x++ )); do
echo $lame "track_$x.wav" "track_$x.mp3";
done;
}
first_half &
first_pid=$!
#second_half &
#second_pid=$
Here's the output of the script.
user@host:~/ogg/noartist/unknown_disc$ ./encode.sh
user@host:~/ogg/noartist/unknown_disc$ lame: excess arg The
lame: excess arg The
Lame complains for each loop iteration... of course.
I changed the script to echo out one of the iterations of the loop and this is what is outputted.
lame -b 320 --ta "New Kids On The Block" --tl "The Block" --ty 2008 track_01.wav track_01.mp3
This works line fine on the shell... I'm confused. What am I doing wrong here? I know it has to do with the spaces in my variables, but I'm not sure how to fix it.
Thanks :)