LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-19-2005, 12:47 PM   #31
infinity42
Member
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 142

Rep: Reputation: 16

Could you post a sample of the input files you're using? Then I can have a closer look at exactly what's going wrong, Thanks.
 
Old 09-19-2005, 01:02 PM   #32
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Upon playing with it more, I am having trouble with another section. Oddly enough, when the request queue is cleared and the default playlist is moved backed and reloaded, only 802 songs are in the file (should be 5123), and then shoutcast crashed.
 
Old 09-19-2005, 01:06 PM   #33
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Sure. Is this what you're looking for?

Here is a snippet of the default playlist (The request file will look similar):

/video3/MythMusic/Santana/Supernatural/Carlos Santana - Supernatural - 09 - Corazon Espinada - featuring Mana.mp3
/video3/MythMusic/Santana/Supernatural/Carlos Santana - Supernatural - 10 - Wishing It Was - featuring Eagle-Eye Cherry.mp3
/video3/MythMusic/Santana/Supernatural/Carlos Santana - Supernatural - 11 - El Farol.mp3
/video3/MythMusic/Santana/Supernatural/Carlos Santana - Supernatural - 12 - Primavera.mp3
/video3/MythMusic/Santana/Supernatural/Carlos Santana - Supernatural - 13 - The Calling - featuring Eric Clapton.mp3
/video3/MythMusic/Top Gun - Anthem.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/01 - Welcome To The Jungle.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/02 - Its So Easy.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/03 - Nightrain.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/04 - Out Ta Get Me.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/05 - Mr Brownstone.mp3
/video3/MythMusic/Guns 'N' Roses/Appetite For Destruction/06 - Paradise City.mp3


And the Log File:

<09/19/05@13:03:02> [DECODE] Opened 06 - Something To Believe In.mp3
<09/19/05@13:03:02> [STREAM] Host server gave success (OK2)
<09/19/05@13:03:02> [STREAM] Stream to 192.168.1.103 established
<09/19/05@13:03:02> [STREAM] Sending stream information
<09/19/05@13:03:02> [CONFIG] WARNING: No InputSamplerate defined, assuming 44100!
<09/19/05@13:03:02> [CONFIG] WARNING: No InputChannels defined, assuming 2!
<09/19/05@13:03:02> Warning: input file samplerate is -1216252864 Hz, must be 44100!
<09/19/05@13:03:02> Warning: input file samplerate is -1216252864 Hz, must be 44100!
<09/19/05@13:03:03> [DECODE] Opened 06 - Freedom.mp3
<09/19/05@13:03:05> [MAIN] Title Updated
 
Old 09-19-2005, 01:11 PM   #34
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Taking a closer look at the file when it gets chopped off.....

/video3/MythMusic/Offspring/Ixnay on the Hombre/04 - Me & My Old Lady.mp3
/video3/MythMusic/Offspring/Ixnay on the Hombre/05 - Cool to Hate.mp3
/video3/MythMusic/Offspring/Ixnay on the Hombre/06 - Leave It Behind.mp3
/video3/MythMusic/Offspring/Ixnay on the Hombre/05 - Cool to Hate.mp3
/video3/MythMusic/Offspring/Ixnay on the Hombre/06 - Leave It Behind.mp3
/video3/MythMusic/Offspring/Ixnay on the Hombre/07 - Gone Away.m


It always stopps at that last file with a .m instead of .mp3. I wonder if the playlist is queued up, before the file is moved. Is there any other reason for it not moving the entire file over?

Last edited by windisch; 09-19-2005 at 01:13 PM.
 
Old 09-19-2005, 02:29 PM   #35
infinity42
Member
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 142

Rep: Reputation: 16
I've just had a play around, and this is what I have come up with:
Code:
#!/bin/bash
process=sc_trans_linux  # Process name
t=`pidof $process`      # Grabs PID
echo 'PID: '$t
PL_FILE='list.txt'      # Playlist to play from 
PL_FILE2='pllist.txt'   # DEFAULT playlist, NEVER actually played from, only used to reset playlist
REQ_FILE='req.txt'      # Request file
LOG_FILE='log.txt'      # Log file
curfile="NON"           # Just incase it doesn't get set on the first pass
echo>>$LOG_FILE
echo>>$REQ_FILE
tail --lines=1 -f $LOG_FILE $REQ_FILE|while read line;do
        if [ "$line" = "==> $REQ_FILE <==" ];then
                curfile="REQ"
        fi
        if [ "$line" = "==> $LOG_FILE <==" ];then
                curfile="LOG"
        fi
        if [ ! -f "$PL_FILE" ];then
                #Playlist file doesn't exist, so copy the default playlist over and signal shoutcast
                echo 'CREATE: '$PL_FILE' from default playlist; '$PL_FILE2
                cp $PL_FILE2 $PL_FILE
                kill -s USR2 $t
        fi
        if [ ! -z "`echo $line|sed 's/.*==>.*<==.*//'`" ];then
                if [ $curfile = "LOG" ];then
                        echo '===LOG> '$line
                        cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
                        filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
                        if [ ! -z "$cmd" ];then
                                if [ "$cmd" = "DECODE" ];then
                                        #Remove the file from the playlist
                                        echo 'REMOVE: '$filename' from '$PL_FILE
                                        cat $PL_FILE|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE
                                fi
                        fi
                fi
                if [ $curfile = "REQ" ];then
                        echo '===REQ> '$line
                        echo 'REQUEST: '$line
                        #Remove it if it's already in the playlist & add the file to the playlist
                        cat $PL_FILE|awk '! /'"$line"'$/ {print $L}'>$PL_FILE
                        echo $line >> $PL_FILE
                fi
        fi
        if [ `wc -c $PL_FILE|sed 's/ .*//'` -eq 0 ];then
                #Playlist is empty, so remove the file and copy over the default list
                echo 'RESET: '$PL_FILE', File is empty'
                rm -f $PL_FILE
                cp $PL_FILE2 $PL_FILE
                kill -s USR2 $t
                kill -s USR1 $t
        fi
done
I've put some more comments in, I think it does what you want it to, but I'm not positive. I've made it quite verbose. Make sure you change the file paths at the top, I changed them to a few temporary files I was using to test it.

It's logic is thus:
Code:
When $PL_FILE is empty: Replace $PL_FILE with a copy of $PL_FILE2
When $PL_FILE doesn't exist: Copy $PL_FILE2 to $PL_FILE
When DECODE command found in $LOG_FILE: Remove the file from $PL_FILE
When a request is placed in $REQ_FILE: Remove request from $PL_FILE if it is already in there, then add the request to $PL_FILE
Hope that is the logic you were after; if not I'll change it.
 
Old 09-19-2005, 03:03 PM   #36
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Here is how the logic should go. We should probably switch the PL_FILE and PL_FILE2 because I think it is kinda backwards and my fault.

Code:
PL_FILE2 or MythMusic.alw is the file that is always being used by shoutcast.
(Before a request is added, there should be no removing of songs from the Playlist.)

When a request is added to $REQ_FILE or request.alw Do the Following:
If $PL_FILE does not exist (meaning that the default file has not been moved to the temp file) then
  Move $PL_FILE2 or MythMusic.alw to $PL_FILE or MythMusic.temp
  Touch $PL_FILE2 (since the file was moved)
  Copy contents of $REQ_FILE to $PL_FILE2  (Or move the file instead of touch/copy)
else
  Copy newly requested song to $PL_FILE2

(After that takes place)
Monitor $LOG_FILE or sc_trans.log.
If DECODE command found in $LOG_FILE
  Remove the file from $PL_FILE2
If $PL_FILE2 is empty
  Move $PL_FILE to $PL_FILE2
I hope that clears up my goals. I'm sorry to keep causing so much trouble.

Last edited by windisch; 09-19-2005 at 03:05 PM.
 
Old 09-20-2005, 01:28 PM   #37
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
I looked over the code I had before from you. We were close and I think by adding one if then statement, it will do the job.

Code:
#!/bin/bash
process=sc_trans_linux  ###Process name entered into variable###
t=`pidof $process`      ###Grabs PID and enters it into variable###
echo $t
PL_FILE='MythMusic.temp'
PL_FILE2='MythMusic.alw'
PL_FILE3='test.alw'
REQ_FILE='/var/www/html/shoutcast/request.alw'
LOG_FILE='/home/draco/shoutcast/transcode/sc_trans.log'
curfile="NON" #Just incase it doesn't get set on the first pass
tail -f --lines=1 $LOG_FILE $REQ_FILE|while read line;do
        if [ "$line" = "==> $REQ_FILE <==" ];then
                curfile="REQ"
        fi
        if [ "$line" = "==> $LOG_FILE <==" ];then
                curfile="LOG"
        fi
        if [ ! -z "`echo $line|sed 's/.*==>.*<==.*//'`" ];then
                if [ ! -f $PL_FILE ];then     #Will Ignore Removing Songs If Default List Is Loaded
                        echo "Ignoring Log"
                else
                        if [ $curfile = "LOG" ];then
                                cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
                                filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
                                if [ $cmd = "DECODE" ];then
                                        cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
                                        #cat $PL_FILE2|awk '! /^'"$filename"'$/ {print $L}'>$PL_FILE2
                                        echo "Requested Song $filename Has Been Played.  Removing From Playlist."
                                fi
                        fi
                fi
                if [ $curfile = "REQ" ];then
                        if [ ! -f $PL_FILE ];then
                                #If it doesn't exist then create an empty file using touch and add song to list
                                echo "Song Requested.  New Request Playlist To Be Created"
                                mv $PL_FILE2 $PL_FILE
                                touch $PL_FILE2
                                echo $line >> $PL_FILE2
                                kill -s USR2 $t
                                kill -s USR1 $t
                        else
                                echo "Song Requested.  Added To Current Playlist"
                                echo $line >> $PL_FILE2  #Adds To Currently Plaing Request List
                                kill -s USR1 $t
                        fi
                fi
        fi
        if [ `wc -c $PL_FILE2|sed 's/ .*//'` -eq 0 ];then
                echo "Request Playlist Is Empty, Reverting To Default Playlist"
                mv $PL_FILE $PL_FILE2
                kill -s USR2 $t
                kill -s USR1 $t
        fi
done
I still get a segmentation fault when it tries to switch back to the default list. Is there a way we can change it to default playlist or remove a song after "[MAIN] Title Updated" Shows? Or set a time delay? Maybe 10-30 seconds? I'm thinking that Shoutcast doesn't like me reloading the playlist at the exact same time as transcoding a song.

Example:

<07/06/05@22:38:09> [DECODE] Opened Weezer - Green - 05 - Crab.mp3
<07/06/05@22:38:32> [MAIN] Title Updated
<07/06/05@22:40:39> [DECODE] Opened 16 - I Can Fly.mp3
<07/06/05@22:41:01> [MAIN] Title Updated

[Main] Title Updated shows after the song has been completely transcoded.

Last edited by windisch; 09-20-2005 at 01:30 PM.
 
Old 09-20-2005, 04:36 PM   #38
infinity42
Member
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 142

Rep: Reputation: 16
I'll take a look tomorrow, having a rest day today . Don't worry, you're not being pushy, just thought you might want to know what was happening on my end.
 
Old 09-21-2005, 06:30 AM   #39
infinity42
Member
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 142

Rep: Reputation: 16
Quote:
I still get a segmentation fault when it tries to switch back to the default list. Is there a way we can change it to default playlist or remove a song after "[MAIN] Title Updated" Shows? Or set a time delay? Maybe 10-30 seconds? I'm thinking that Shoutcast doesn't like me reloading the playlist at the exact same time as transcoding a song.
Yes, all we need to do is replace this block of code:
Code:
cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
if [ $cmd = "DECODE" ];then
    cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
    echo "Requested Song $filename Has Been Played.  Removing From Playlist."
fi
with something like this:
Code:
cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
msg=$(echo $line|sed 's/.*\] \(.*\)/\/1/')
if [ "$cmd" = "DECODE" ];then
    filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
    echo 'DECODE: '$filename
fi
if [ "$cmd"="MAIN" -a "$msg"="Title Updated" ];then
    if [ ! -z "$filename" ];then
        echo "Requested Song $filename Has Been Played.  Removing From Playlist."
        cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
        filename=""
    fi
fi
This just saves the filename from any DECODE commands, and then removes that file from PL_FILE2 on the next '[Main] Title Updated' log entry. It also then clears filename to prevent it from being removed again (paranoia really).

Hope that helps!
 
Old 09-21-2005, 07:46 AM   #40
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
It still doesn't wait for the "Title Updated" Message to appear. I was watching the script and log while it worked, and it immediately loaded the default playlist upon playing the song. I'm going to post the entire script to make sure that I didn't add it in the wrong place.

Code:
#!/bin/bash
process=sc_trans_linux  ###Process name entered into variable###
t=`pidof $process`      ###Grabs PID and enters it into variable###
echo $t
PL_FILE='MythMusic.temp'
PL_FILE2='MythMusic.alw'
PL_FILE3='test.alw'
REQ_FILE='/var/www/html/shoutcast/request.alw'
LOG_FILE='/home/draco/shoutcast/transcode/sc_trans.log'
curfile="NON" #Just incase it doesn't get set on the first pass
tail -f --lines=1 $LOG_FILE $REQ_FILE|while read line;do
        if [ "$line" = "==> $REQ_FILE <==" ];then
                curfile="REQ"
        fi
        if [ "$line" = "==> $LOG_FILE <==" ];then
                curfile="LOG"
        fi
        if [ ! -z "`echo $line|sed 's/.*==>.*<==.*//'`" ];then
                if [ ! -f $PL_FILE ];then   #Will Ignore Removing Songs If Default List Is Loaded
                        echo "Ignoring Log"
                else
                        if [ $curfile = "LOG" ];then
                                cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
                                msg=$(echo $line|sed 's/.*\] \(.*\)/\/1/')
                                if [ "$cmd" = "DECODE" ];then
                                    filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
                                    echo 'DECODE: '$filename
                                fi
                                if [ "$cmd"="MAIN" -a "$msg"="Title Updated" ];then
                                    if [ ! -z "$filename" ];then
                                        echo "Requested Song $filename Has Been Played.  Removing From Playlist."
                                        cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
                                        filename=""
                                    fi
                                fi
                        fi
                fi
                if [ $curfile = "REQ" ];then
                        if [ ! -f $PL_FILE ];then   #If it doesn't exist then create an empty file using touch and add song to list
                                echo "Song Requested.  New Request Playlist To Be Created"
                                mv $PL_FILE2 $PL_FILE
                                touch $PL_FILE2
                                echo $line >> $PL_FILE2
                                kill -s USR2 $t
                                kill -s USR1 $t
                        else
                                echo "Song Requested.  Added To Current Playlist"
                                echo $line >> $PL_FILE2   #Adds To Currently Plaing Request List
                                kill -s USR1 $t
                        fi
                fi
        fi
        if [ `wc -c $PL_FILE2|sed 's/ .*//'` -eq 0 ];then
                echo "Request Playlist Is Empty, Reverting To Default Playlist"
                mv $PL_FILE $PL_FILE2
                kill -s USR2 $t
                kill -s USR1 $t
        fi
 
Old 09-21-2005, 08:00 AM   #41
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
I played with the script some more, and oddly enough, when there is more then 1 song in the queue, it does not remove the song from the list. Also, when I added a song during the decoding process, it gave me a segmentation fault. So shoutcast definitely does not like me reloading the playlist at that point. So, once we can get the script to correctly detect the Title Updated message, I'm going to need to have that in multiple places so that I don't get the error when a song is requested. Thanks again for your help.
 
Old 09-21-2005, 08:05 AM   #42
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Ok, now I'm confused. This time it worked correctly. Let me play with it some more before I bother you again.
 
Old 09-21-2005, 08:17 AM   #43
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Ok, I think the previous message was a fluke. Here is an example of the script not waiting until the "Title Updated" Message Shows.

<09/21/05@08:12:05> [DECODE] Opened Toad The Wet Sprocket - Fear - 09.In My Ear_192.mp3
<09/21/05@08:12:06> [MAIN] Title Updated
<09/21/05@08:12:55> [MAIN] SIGUSR2; Toggle Shuffle off
<09/21/05@08:12:55> [MAIN] SIGUSR1; Reload Playlist
<09/21/05@08:12:55> [MAIN] Reloading playlist
<09/21/05@08:12:55> [MAIN] Loading playlist (MythMusic.alw)
<09/21/05@08:12:55> [MAIN] Found (1) entries in playlist
<09/21/05@08:14:50> [DECODE] Opened 1-01_Scars_Left_by_Time.mp3
<09/21/05@08:14:50> [MAIN] SIGUSR2; Toggle Shuffle on
<09/21/05@08:14:50> [MAIN] SIGUSR1; Reload Playlist
<09/21/05@08:14:50> [MAIN] Reloading playlist
<09/21/05@08:14:50> [MAIN] Loading playlist (MythMusic.alw)
<09/21/05@08:14:50> [MAIN] Read 2500 playlist entries...
<09/21/05@08:14:50> [MAIN] Read 5000 playlist entries...
<09/21/05@08:14:50> [MAIN] Found (5123) entries in playlist

After this last line, I get the seg fault.
 
Old 09-21-2005, 11:48 AM   #44
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
I found the issue. I was missing the actual command to reload the playlist. But it is still not waiting for the Title Updated before reloading the playlist, which causes a crash.

Code:
#!/bin/bash
process=sc_trans_linux  ###Process name entered into variable###
t=`pidof $process`      ###Grabs PID and enters it into variable###
echo $t
PL_FILE='MythMusic.temp'
PL_FILE2='MythMusic.alw'
PL_FILE3='test.alw'
REQ_FILE='/var/www/html/shoutcast/request.alw'
LOG_FILE='/home/draco/shoutcast/transcode/sc_trans.log'
curfile="NON" #Just incase it doesn't get set on the first pass
tail -f --lines=1 $LOG_FILE $REQ_FILE|while read line;do
        if [ "$line" = "==> $REQ_FILE <==" ];then
                curfile="REQ"
        fi
        if [ "$line" = "==> $LOG_FILE <==" ];then
                curfile="LOG"
        fi
        if [ ! -z "`echo $line|sed 's/.*==>.*<==.*//'`" ];then
                if [ ! -f $PL_FILE ];then   #Will Ignore Removing Songs If Default List Is Loaded
                        echo "Ignoring Log"
                else
                        if [ $curfile = "LOG" ];then
                                cmd=$(echo $line|sed 's/.*\[\(.*\)\].*/\1/')
                                msg=$(echo $line|sed 's/.*\] \(.*\)/\/1/')
                                if [ "$cmd" = "DECODE" ];then
                                    filename=$(echo $line|sed 's/.*\] Opened \(.*\)/\1/')
                                    echo 'DECODE: '$filename
                                fi
                                if [ "$cmd"="MAIN" -a "$msg"="Title Updated" ];then
                                    if [ ! -z "$filename" ];then
                                        echo "Requested Song $filename Has Been Played.  Removing From Playlist."
                                        cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
                                        kill -s USR1 $t
                                        filename=""
                                    fi
                                fi
                        fi
                fi
                if [ $curfile = "REQ" ];then
                        if [ ! -f $PL_FILE ];then   #If it doesn't exist then create an empty file using touch and add song to list
                                echo "Song Requested.  New Request Playlist To Be Created"
                                mv $PL_FILE2 $PL_FILE
                                touch $PL_FILE2
                                chmod 666 $PL_FILE2
                                echo $line >> $PL_FILE2
                                kill -s USR2 $t
                                kill -s USR1 $t
                        else
                                echo "Song Requested.  Added To Current Playlist"
                                echo $line >> $PL_FILE2   #Adds To Currently Plaing Request List
                                kill -s USR1 $t
                        fi
                fi
        fi
        if [ `wc -c $PL_FILE2|sed 's/ .*//'` -eq 0 ];then
                echo "Request Playlist Is Empty, Reverting To Default Playlist"
                mv $PL_FILE $PL_FILE2
                kill -s USR2 $t
                kill -s USR1 $t
        fi
done
I was thinking that once we get the Title Updated part to work, we could move
Code:
if [ `wc -c $PL_FILE2|sed 's/ .*//'` -eq 0 ];then
                echo "Request Playlist Is Empty, Reverting To Default Playlist"
                mv $PL_FILE $PL_FILE2
                kill -s USR2 $t
                kill -s USR1 $t
        fi
Inside of the script to remove the file. That way after removing the song, it checks for an empty queue and does its command after the Title Updated shows. Let me know what you think.
 
Old 09-21-2005, 03:08 PM   #45
windisch
Member
 
Registered: Nov 2004
Location: Gahanna, Ohio, USA
Distribution: Fedora 9
Posts: 158

Original Poster
Rep: Reputation: 30
Just an FYI, I echoed the content of $cmd and $msg at the time of
Code:
                               if [ "$cmd"="MAIN" -a "$msg"="Title Updated" ];then
                                    if [ ! -z "$filename" ];then
                                        echo "$cmd $msg"
                                        echo "Requested Song $filename Has Been Played.  Removing From Playlist."
                                        cat $PL_FILE2|awk '! /'"$filename"'$/ {print $L}'>$PL_FILE2
                                        kill -s USR1 $t
                                        filename=""
                                    fi
                                fi
This is the output:
DECODE /1

It ran the if statement even though $cmd did not equal "MAIN" or $msg "Title Updated".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
creating shell script programming using KNOPPIX.. help cinderella Linux - Newbie 4 12-20-2004 08:12 PM
Creating a shell script to run Java program paultaylor Programming 7 11-12-2004 04:11 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 11:23 PM
Help creating a directory back up shell script WarriorWarren Linux - General 6 04-06-2003 10:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration