Register
It is currently Thu Apr 17, 2014 6:32 am

PCRadio music import script


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Sat Oct 14, 2006 11:42 pm   
User avatar

Joined: Mon Jul 03, 2006 8:58 pm
Posts: 52
Location: Rochester, NY
This is just the stub of a script that will be used as part of my PCRadio OSS project. The purpose of the script is to query the user about how and where music is to be imported from and written to. At this point it only reads input and writes those preferences to file. Additionally, if the preferences file exists, it will read that in and provide those preferences as the default values the next time the script is called.

Comments welcome on how I can make it prettier/more efficient/etc. I'll update it as I get time to work on it.

Cheers!
Brion

Code:
#!/bin/bash

###############
# Name: importMusic.sh
# Author: Brion Swanson
# Desc: This script questions the user about the location of the music
#       from which it will be imported and to where it will be stored.
#
#       This script stores the answers of the response in a file called
#       .importPrefs in the user's home directory and will pre-populate
#       the responses to the questions if it exists.
#
#       Files will be moved from the source to the destination and renamed
#       according to the MP3/Ogg tagging if available.  The format of the
#       file name can be configured by the user.
###############

###############
# Variables   #
###############
SRCDIR=".";
DESTDIR="/usr/share/music/";
RENAMEFILES="yes";
MOVEFILES="yes";
FNAMEFORMAT="R-A-T";
MOVECMD=`which mv`;

###############
# Functions   #
###############

### readPrefs
# Read user preferences from ~/.importPrefs (if it exists) and set
# the variables to those defaults
#####
readPrefs() {
        for line in `cat ~/.importPrefs`; do
                var=`echo $line | cut -d= -s -f1`;
                value=`echo $line | cut -d= -s -f2`;

                case ${var} in
                        sourceDir)
                                SRCDIR="$value";
                                ;;
                        destDir)
                                DESTDIR="$value";
                                ;;
                        renameFiles)
                                RENAMEFILES="$value";
                                ;;
                        moveFiles)
                                MOVEFILES="$value";
                                ;;
                        filenameFormat)
                                FNAMEFORMAT="$value";
                                ;;
                        moveCmd)
                                MOVECMD="$value";
                                ;;
                esac
        done
}

### writePrefs
# Writes the user's preferences out to the ~/.importPrefs file.
# These values will be read in as the default choices next time
# the script is run.
#####
writePrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # clear out the previous preferences file
        # and write a header to warn people not to modify by hand
        echo "## This is a generated file - changes made by hand will be lost ##" > ~/.importPrefs;

        # now loop through the array writing out the data to file
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}" >> ~/.importPrefs
        done
}

### rebuildFilename
# Analyzes the MP3 or Ogg file's metadata and attempts to generate
# an approprite file name based on the user's preferred filename
# format (default: aRtist-Album-Track). Returns the generated name.
#####
buildFilename() {
echo "";
}

### normalizeFilename
# Normalizes filenames by removing apostrophes and quotes and converting
# parentheses and spaces to underscores.
#####
normalizeFilename() {
echo "";
}

###############
# Script      #
###############
if [ -e ~/.importPrefs ]
then
        readPrefs
fi

# do user questionaire here
read -p "Source directory? [$SRCDIR] " NEWSRCDIR
if [ -n "$NEWSRCDIR" ]
then
        SRCDIR="$NEWSRCDIR";
fi

read -p "Destination directory? [$DESTDIR] " NEWDESTDIR
if [ -n "$NEWDESTDIR" ]
then
        DESTDIR="$NEWDESTDIR";
fi

read -p "Rename destination file? [$RENAMEFILES] " NEWRENAMEFILE
if [ -n "$NEWRENAMEFILE" ]
then
        RENAMEFILES="$NEWRENAMEFILE";
fi

read -p "Move files from destination to source? [$MOVEFILES] " NEWMOVEFILES
if [ -n "$NEWMOVEFILES" ]
then
        MOVEFILES="$NEWMOVEFILES";
fi

read -p "Filename format pattern (aRtist, Album, Track) [$FNAMEFORMAT] " NEWFNAMEFORMAT
if [ -n "$NEWFNAMEFORMAT" ]
then
        FNAMEFORMAT="$NEWFNAMEFORMAT";
fi

read -p "Command to transfer files from source to dest? [$MOVECMD] " NEWMOVECMD
if [ -n "$NEWMOVECMD" ]
then
        MOVECMD="$NEWMOVECMD";
fi

echo "Saving preferences...";
writePrefs;

# if file rename, do conversion here (call normalize function)

# copy/move file

# call insert function to the DB here

echo "Done!";


Top
 Profile WWW  
 PostPosted: Mon Oct 16, 2006 5:37 am   
User avatar

Joined: Mon Jul 03, 2006 8:58 pm
Posts: 52
Location: Rochester, NY
Update: I've added a command-line argument (-c --configure) to explicitly invoke the configuration questionaire. If the .importPrefs file already exists, then the preferences are pulled from it and the process runs automatically without any interaction from the user. If the the .importPrefs file does not exist or -c (--configure) is specified on the command-line then the preferences are read from the user and create/overwrite the existing .importPrefs file.

Problem: if I create a function to handle command-line argument parsing then I lose the command-line arguments $1 and so-forth. In the current code where command-line parsing occurs first it correctly determines the value of $DOCONFIG but for some reason the check for .importPrefs fails and sets the value of DOCONFIG to 'yes' when it should remain 'no' given the scenario: .importPrefs exists and -c was not passed on the command line. It should just produce "Done!' without doing anything.

Any suggestions are welcome.

Code:
#!/bin/bash

###############
# Name: importMusic.sh
# Author: Brion Swanson
# Desc: This script questions the user about the location of the music
#       from which it will be imported and to where it will be stored.
#
#       This script stores the answers of the response in a file called
#       .importPrefs in the user's home directory and will pre-populate
#       the responses to the questions if it exists.
#
#       Files will be moved from the source to the destination and renamed
#       according to the MP3/Ogg tagging if available.  The format of the
#       file name can be configured by the user.
###############

###############
# Variables   #
###############
SRCDIR=".";
DESTDIR="/usr/share/music/";
RENAMEFILES="yes";
MOVEFILES="yes";
FNAMEFORMAT="R-A-T";
MOVECMD=`which mv`;
DOCONFIG="no";

###############
# Functions   #
###############

### readPrefs
# Read user preferences from ~/.importPrefs (if it exists) and set
# the variables to those defaults
#####
readPrefs() {
        for line in `cat ~/.importPrefs`; do
                var=`echo $line | cut -d= -s -f1`;
                value=`echo $line | cut -d= -s -f2`;

                case ${var} in
                        sourceDir)
                                SRCDIR="$value";
                                ;;
                        destDir)
                                DESTDIR="$value";
                                ;;
                        renameFiles)
                                RENAMEFILES="$value";
                                ;;
                        moveFiles)
                                MOVEFILES="$value";
                                ;;
                        filenameFormat)
                                FNAMEFORMAT="$value";
                                ;;
                        moveCmd)
                                MOVECMD="$value";
                                ;;
                esac
        done
}

### writePrefs
# Writes the user's preferences out to the ~/.importPrefs file.
# These values will be read in as the default choices next time
# the script is run.
#####
writePrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # clear out the previous preferences file
        # and write a header to warn people not to modify by hand
        echo "## This is a generated file - changes made by hand will be lost ##" > ~/.importPrefs;

        # now loop through the array writing out the data to file
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}" >> ~/.importPrefs
        done
}

### rebuildFilename
# Analyzes the MP3 or Ogg file's metadata and attempts to generate
# an approprite file name based on the user's preferred filename
# format (default: aRtist-Album-Track). Returns the generated name.
#####
buildFilename() {
echo "";
}

### normalizeFilename
# Normalizes filenames by removing apostrophes and quotes and converting
# parentheses and spaces to underscores.
#####
normalizeFilename() {
echo "";
}

###############
# Script      #
###############

echo $DOCONFIG

if [ $# > 0 ]; then
    echo $1;
        if [ -n $1 ]; then
                if [ $1=="-c" -o $1=="--configure" ]
                then
                        DOCONFIG="yes"
                fi
        fi
fi

echo $DOCONFIG

# read in any saved preferences first
if [ -e ~/.importPrefs ]
then
        readPrefs
else
        DOCONFIG="yes"
fi

echo $DOCONFIG

# do user questionaire here if necessary
if [ $DOCONFIG == "yes" ]; then
        read -p "Source directory? [$SRCDIR] " NEWSRCDIR
        if [ -n "$NEWSRCDIR" ]
        then
                SRCDIR="$NEWSRCDIR";
        fi

        read -p "Destination directory? [$DESTDIR] " NEWDESTDIR
        if [ -n "$NEWDESTDIR" ]
        then
                DESTDIR="$NEWDESTDIR";
        fi

        read -p "Rename destination file? [$RENAMEFILES] " NEWRENAMEFILE
        if [ -n "$NEWRENAMEFILE" ]
        then
                RENAMEFILES="$NEWRENAMEFILE";
        fi

        read -p "Move files from destination to source? [$MOVEFILES] " NEWMOVEFILES
        if [ -n "$NEWMOVEFILES" ]
        then
                MOVEFILES="$NEWMOVEFILES";
        fi

        read -p "Filename format pattern (aRtist, Album, Track) [$FNAMEFORMAT] " NEWFNAMEFORMAT
        if [ -n "$NEWFNAMEFORMAT" ]
        then
                FNAMEFORMAT="$NEWFNAMEFORMAT";
        fi

        read -p "Command to transfer files from source to dest? [$MOVECMD] " NEWMOVECMD
        if [ -n "$NEWMOVECMD" ]
        then
                MOVECMD="$NEWMOVECMD";
        fi

        echo "Saving preferences...";
        writePrefs;
fi

# if file rename, do conversion here (call normalize function)

# copy/move file

# call insert function to the DB here

echo "Done!";


Top
 Profile WWW  
 PostPosted: Wed Oct 18, 2006 5:47 am   
User avatar

Joined: Mon Jul 03, 2006 8:58 pm
Posts: 52
Location: Rochester, NY
Another update. Fixed the problem with the previous test (forgot quotes around the variable), now I'm trying to get a case statement to fall through. This version has the case targets duplicated so it works, but I'd prefer -c fall through to --configure and just put the code in there once.

I promise this will do something useful soon. :)

Code:
#!/bin/bash

###############
# Name: importMusic.sh
# Author: Brion Swanson
# Desc: This script questions the user about the location of the music
#       from which it will be imported and to where it will be stored.
#
#       This script stores the answers of the response in a file called
#       .importPrefs in the user's home directory and will pre-populate
#       the responses to the questions if it exists.
#
#       Files will be moved from the source to the destination and renamed
#       according to the MP3/Ogg tagging if available.  The format of the
#       file name can be configured by the user.
###############

## uncomment for debugging
#set -xe

###############
# Variables   #
###############

SRCDIR=".";
DESTDIR="/usr/share/music/";
RENAMEFILES="no";
MOVEFILES="yes";
FNAMEFORMAT="R-A-T";
MOVECMD=`which cp`;
DOCONFIG="no";
VERBOSE="no";

###############
# Functions   #
###############

### readPrefs
# Read user preferences from ~/.importPrefs (if it exists) and set
# the variables to those defaults
#####

readPrefs() {
        for line in `cat ~/.importPrefs`; do
                var=`echo $line | cut -d= -s -f1`;
                value=`echo $line | cut -d= -s -f2`;

                case ${var} in
                        sourceDir)
                                SRCDIR="$value";
                                ;;
                        destDir)
                                DESTDIR="$value";
                                ;;
                        renameFiles)
                                RENAMEFILES="$value";
                                ;;
                        moveFiles)
                                MOVEFILES="$value";
                                ;;
                        filenameFormat)
                                FNAMEFORMAT="$value";
                                ;;
                        moveCmd)
                                MOVECMD="$value";
                                ;;
                esac
        done
}

### writePrefs
# Writes the user's preferences out to the ~/.importPrefs file.
# These values will be read in as the default choices next time
# the script is run.
#####

writePrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # clear out the previous preferences file
        # and write a header to warn people not to modify by hand
        echo "## This is a generated file - changes made by hand will be lost ##" > ~/.importPrefs;

        # now loop through the array writing out the data to file
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}" >> ~/.importPrefs
        done
}

### dumpPrefs
# Writes the user's preferences out to the screen.
#####

dumpPrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # now loop through the array writing out the data to the screen
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}"
        done
}

### rebuildFilename
# Analyzes the MP3 or Ogg file's metadata and attempts to generate
# an approprite file name based on the user's preferred filename
# format (default: aRtist-Album-Track). Returns the generated name.
#####

buildFilename() {
echo "";
}

### normalizeFilename
# Normalizes filenames by removing apostrophes and quotes and converting
# parentheses and spaces to underscores.
#####

normalizeFilename() {
echo "";
}

###############
# Script      #
###############

if [ $# > 0 ]; then
    arg=$1;
        while [ -n "$arg" ]; do
                case ${arg} in
                        -v)
                                VERBOSE="yes"
                                ;;
                        --verbose)
                                VERBOSE="yes"
                                ;;
                        -c)
                                DOCONFIG="yes"
                                ;;
                        --configure)
                                DOCONFIG="yes"
                                ;;
                        esac
                shift
                arg=$1;
        done
fi

# read in any saved preferences first
if [ -e ~/.importPrefs ]
then
        readPrefs
else
        DOCONFIG="yes"
fi

# do user questionaire here if necessary
if [ $DOCONFIG == "yes" ]; then
        echo "Please answer the following questions. Press enter to accept the default."

        read -p "Source directory? [$SRCDIR] " NEWSRCDIR
        if [ -n "$NEWSRCDIR" ]
        then
                SRCDIR="$NEWSRCDIR";
        fi

        read -p "Destination directory? [$DESTDIR] " NEWDESTDIR
        if [ -n "$NEWDESTDIR" ]
        then
                DESTDIR="$NEWDESTDIR";
        fi

        read -p "Normalize destination file names? [$RENAMEFILES] " NEWRENAMEFILE
        if [ -n "$NEWRENAMEFILE" ]
        then
                RENAMEFILES="$NEWRENAMEFILE";
        fi

        if [ "$RENAMEFILES"!="no" -a "$RENAMEFILES"!="NO" ]
        then
                read -p "Filename format pattern (aRtist, Album, Track) [$FNAMEFORMAT] " NEWFNAMEFORMAT
                if [ -n "$NEWFNAMEFORMAT" ]
                then
                        FNAMEFORMAT="$NEWFNAMEFORMAT";
                fi
        fi

        if [ "$SRCDIR" != "$DESTDIR" ]
        then
                read -p "Transfer files from destination to source? [$MOVEFILES] " NEWMOVEFILES
                if [ -n "$NEWMOVEFILES" ]
                then
                        MOVEFILES="$NEWMOVEFILES";
                fi

                read -p "Command to transfer files from source to dest? [$MOVECMD] " NEWMOVECMD
                if [ -n "$NEWMOVECMD" ]
                then
                        MOVECMD="$NEWMOVECMD";
                fi
        fi


        echo "Saving preferences...";
        writePrefs;
fi

# if file rename, do conversion here (call normalize function)

# copy/move file

# call insert function to the DB here

if [ "$VERBOSE" == "yes" ]; then
        echo "Preferences:"
        dumpPrefs
        echo ""
fi

echo "Done!";


Top
 Profile WWW  
 PostPosted: Wed Oct 18, 2006 8:13 pm   
User avatar

Joined: Mon Jul 03, 2006 8:58 pm
Posts: 52
Location: Rochester, NY
This update includes code to finally start renaming and tranferring files from $SRCDIR to $DESTDIR. It calls generateName.pl but I haven't written that yet so if you tell it to rename files it will fail. Still have a problem with the second use of 'define' but I'm working on that.

Code:
#!/bin/bash

###############
# Name: importMusic.sh
# Author: Brion Swanson
# Desc: This script questions the user about the location of the music
#       from which it will be imported and to where it will be stored.
#
#       This script stores the answers of the response in a file called
#       .importPrefs in the user's home directory and will pre-populate
#       the responses to the questions if it exists.
#
#       Files will be moved from the source to the destination and renamed
#       according to the MP3/Ogg tagging if available.  The format of the
#       file name can be configured by the user.
###############

## uncomment n for syntax check, xe for debugging
set -xe

###############
# Variables   #
###############

SRCDIR=".";
DESTDIR="/usr/share/music/";
RENAMEFILES="no";
MOVEFILES="yes";
FNAMEFORMAT="R-A-T";
MOVECMD=`which cp`;
DOCONFIG="no";
VERBOSE="no";

###############
# Functions   #
###############

### readPrefs
# Read user preferences from ~/.importPrefs (if it exists) and set
# the variables to those defaults
#####

readPrefs() {
        for line in `cat ~/.importPrefs`; do
                var=`echo $line | cut -d= -s -f1`;
                value=`echo $line | cut -d= -s -f2`;

                case ${var} in
                        sourceDir)
                                SRCDIR="$value";
                                ;;
                        destDir)
                                DESTDIR="$value";
                                ;;
                        renameFiles)
                                RENAMEFILES="$value";
                                ;;
                        moveFiles)
                                MOVEFILES="$value";
                                ;;
                        filenameFormat)
                                FNAMEFORMAT="$value";
                                ;;
                        moveCmd)
                                MOVECMD="$value";
                                ;;
                esac
        done
}

### writePrefs
# Writes the user's preferences out to the ~/.importPrefs file.
# These values will be read in as the default choices next time
# the script is run.
#####

writePrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # clear out the previous preferences file
        # and write a header to warn people not to modify by hand
        echo "## This is a generated file - changes made by hand will be lost ##" > ~/.importPrefs;

        # now loop through the array writing out the data to file
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}" >> ~/.importPrefs
        done
}

### dumpPrefs
# Writes the user's preferences out to the screen.
#####

dumpPrefs() {
        # create an array to hold all the data to be written out
        # for ease and speed of writing
        declare -a state;

        # add each piece of state data to the array in order
        state[0]="sourceDir=$SRCDIR";
        state[1]="destDir=$DESTDIR";
        state[2]="renameFiles=$RENAMEFILES";
        state[3]="moveFiles=$MOVEFILES";
        state[4]="filenameFormat=$FNAMEFORMAT";
        state[5]="moveCmd=$MOVECMD";

        # now loop through the array writing out the data to the screen
        stateCount=${#state[*]}
        for (( i=0; $i != $stateCount; i++ )) do
                echo "${state[$i]}"
        done
}

### rebuildFilename
# Analyzes the MP3 or Ogg file's metadata and attempts to generate
# an approprite file name based on the user's preferred filename
# format (default: aRtist-Album-Track). Returns the generated name.
#####

buildFilename() {
echo "";
}

### normalizeFilename
# Normalizes filenames by removing apostrophes and quotes and converting
# parentheses and spaces to underscores.
#####

normalizeFilename() {
echo "";
}

###############
# Script      #
###############

if [ $# > 0 ]; then
    arg=$1;
        while [ -n "$arg" ]; do
                case ${arg} in
                        -v)
                                VERBOSE="yes"
                                ;;
                        --verbose)
                                VERBOSE="yes"
                                ;;
                        -c)
                                DOCONFIG="yes"
                                ;;
                        --configure)
                                DOCONFIG="yes"
                                ;;
                        esac
                shift
                arg=$1;
        done
fi

# read in any saved preferences first
if [ -e ~/.importPrefs ]
then
        readPrefs
else
        DOCONFIG="yes"
fi

# do user questionaire here if necessary
if [ $DOCONFIG == "yes" ]; then
        echo "Please answer the following questions. Press enter to accept the default."

        read -p "Source directory? [$SRCDIR] " NEWSRCDIR
        if [ -n "$NEWSRCDIR" ]
        then
                SRCDIR="$NEWSRCDIR";
        fi

        read -p "Destination directory? [$DESTDIR] " NEWDESTDIR
        if [ -n "$NEWDESTDIR" ]
        then
                DESTDIR="$NEWDESTDIR";
        fi

        read -p "Normalize destination file names? [$RENAMEFILES] " NEWRENAMEFILE
        if [ -n "$NEWRENAMEFILE" ]
        then
                RENAMEFILES="$NEWRENAMEFILE";
        fi

        if [ "$RENAMEFILES" == "yes" ]
        then
                read -p "Filename format pattern (aRtist, Album, Track) [$FNAMEFORMAT] " NEWFNAMEFORMAT
                if [ -n "$NEWFNAMEFORMAT" ]
                then
                        FNAMEFORMAT="$NEWFNAMEFORMAT";
                fi
        fi

        if [ "$SRCDIR" != "$DESTDIR" ]
        then
                read -p "Transfer files from destination to source? [$MOVEFILES] " NEWMOVEFILES
                if [ -n "$NEWMOVEFILES" ]
                then
                        MOVEFILES="$NEWMOVEFILES";
                fi

                read -p "Command to transfer files from source to dest? [$MOVECMD] " NEWMOVECMD
                if [ -n "$NEWMOVECMD" ]
                then
                        MOVECMD="$NEWMOVECMD";
                fi
        fi


        echo "Saving preferences...";
        writePrefs;
fi

define -a songs;
pos=0;

# if file rename, do conversion here (call normalize function)
if [ "$RENAMEFILES"="yes" ]; then
        for file in `ls $SRCDIR/*.[mo][pg][3g]`; do
                songs[$pos]=`perl generateName.pl $FNAMEFORMAT $file`;
                pos+=1
        done
else
        for file in `ls $SRCDIR/*.[mo][pg][3g]`; do
                songs[$pos]=$file;
                pos+=1
        done
fi

if [ "$MOVEFILES" == "yes" ]; then
        # copy/move file
        if [ "$SRCDIR" != "$DESTDIR" ]; then
            for (( pos=0; $pos<${#songs[*]}; pos++ )); do
                        echo "Transferring file: $songs[$pos] to $DESTDIR"
                        `$MOVECMD -f $file $DESTDIR/$name 2>&1 >/dev/null`
                done
        else
            for (( pos=0; $pos<${#songs[*]}; pos++ )); do
                        echo "Transferring file: $songs[$pos]"
                        `$MOVECMD -f $file $name 2>&1 >/dev/null`
                done
        fi
fi

# call insert function to the DB here

if [ "$VERBOSE" == "yes" ]; then
        echo "Preferences:"
        dumpPrefs
        echo ""
fi

echo "Done!";


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP