Bash 3.1.7
Hi:
Code:
#!/bin/bash
#
file=$1
infile=$1".cue"
FIRST=1
while read A1 A2 A3 # TRACK 08 AUDIO
do
if [ "$A1" == "TRACK" ]
then
read A1 A2 # TITLE "Piano ..........."
read A1 A2 A3 # INDEX 00 40:18:43
# echo $A3 # 40:18:43
old="$new"
new="$A3"
if [ $FIRST == 1 ]
then
FIRST=0
else
# Here new is 08:28:10
echo "Here I am $new waiting"
fi
echo ----------------
fi
done < "$infile"
echo "flac --skip="$new
exit
The output is
Code:
----------------
waitingm 62:36:67
until=decode --skip=53:40:73
----------------
waitingm 65:53:13
until=decode --skip=62:36:67
--
But it should be
Here I am 08:28:10 waiting. I have tried in a thousand different ways and always 'waiting' overwrites the string. What am I doing wrong?
Part of the input file is
Code:
TRACK 09 AUDIO
TITLE "Piano Sonata No.19 in G minor, op.49 no.1 - II. Rondo. Allegro"
INDEX 01 43:53:30
TRACK 10 AUDIO
TITLE "Piano Sonata No.20 in G major, op.49 no.2 - I. Allegro, ma non troppo"
INDEX 00 47:21:58
INDEX 01 47:29:33 # --> new