All pastes #234336 Raw Edit

gilligan

public text v1 · immutable
·published 2006-11-02 13:20 UTC
rendered paste body
parse_mp3()
{
    artist=`$ID3INFO $1 | grep TPE1 | cut -d: -f 2`
    album=`$ID3INFO $1  | grep TALB | cut -d: -f 2`
    track=`$ID3INFO $1  | grep TRCK | cut -d: -f 2`
    title=`$ID3INFO $1  | grep TIT2 | cut -d: -f 2`

    if [[ $f_query -eq 0 ]]; then
        ls  $1 | sed -e "s/\(.*\)/\1 \|\| artist:$artist\|album:$album\|track:$track\|title:$title/"
    else 
        file_tag=${!query_name}
        query_tag=$query_value

        if [[ "$file_tag"=="$query_tag" ]]; then
            echo $file_tag 
            echo $query_tag
            ls  $1 | sed -e "s/\(.*\)/\1 \|\| artist:$artist\|album:$album\|track:$track\|title:$title/"
        fi
    fi

}


# output: 
#Lindstrom
#Lindstrom
#/home/gilligan/testing//11-lindstrom-the_contemporary_fix.mp3 || artist: Lindstrom|album: Its_A_Feedelity_Affair|track:|title: The Contemporary Fix
#Metal Gear Solid
#Lindstrom
#/home/gilligan/testing//metal_gear_solid.mp3 || artist: Metal Gear Solid|album: Album|track: 18|title: Track 18
# ^ here the strings are not equal ?!?