• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

mp3+ogg playlist script läuft nicht

mycroft

Member
Hallo zusammen,
ich brauche wiedermal Eure Hilfe. Ich habe im INet folgende beiden Scripte gefunden. Ich komme sie
aber nicht zum laufen, ich habe gestern den ganzen Abend versucht die Script zum laufen zu bekommen. Ich blicke es einfach nicht irgendwie steht mir einer verdammt auf der Leitung :)
Fehlermeldungen (sinngemäß) undefiniertes Ende nach done. Oder so ähnlich :) Ich habe die Script hier orginal belassen, damit Ihr auch die Kommentierungen lesen könnten.
Ich hoffe von Euch kann mir jemand helfen, denn die Script finde ich recht nützlich.
Vielen Dank schonmal
Grüße
Tom

Falls es wichtig sein sollte: System Suse Linux 10.0 / KDE 3.4.2a


#1. Script for å lage spillelister
#genplaylists.sh
#This script makes a playlist in every folder recursive in the folder given as an argument. **All* filetypes are included #in the list. Hvis you only want one file type added to the list then edit the laste line
#find . -type f |grep -v m3u|sort> '00-Playlist.m3u'
#and add -iname *.mp3
#find . -type f -iname *.mp3|grep -v m3u|sort> '00-Playlist.m3u'
#Example:
#makeplaylists.sh.pre /pub/audio
#You must make the script executable before using it:
#chmod a+x myfile
#2. make-ogg-playlist
# * make-ogg-playlist.txt
!/bin/bash
#
# make-ogg-playlist v0.1 (By Sam Storie)
#
# Changelog:
# v0.1 Initial Creation
#
#
# This creates a series of XMMS playlist files
# from an ogg library that is organized like:
#
# /home/sam/music
# +- Radiohead
# +- Paranoid_Android
# | +- Track1.ogg
# | +- Track2.ogg
# +- Hail_to_the_Theif
# +- Track1.ogg
# +- Track2.ogg
#
# and creates these files:
# .../music/all.pls (all oggs)
# .../music/Radiohead.pls (from Radiohead)
# ../music/Radiohead/Paranoid_Android.pls (that album only)
# .../music/Radiohead/Hail_to_the_Theif.pls (that album only)
#

# Needs to be full path (ie, ~/music won't work)
ROOT=/home/sam/music
cd $ROOT

BuildPlaylist() {
ct=1
NUM=$(find $1 -type f -name *.ogg | wc -l | awk '{print $1}')
echo "[playlist]" > $2.pls
echo "NumberOfEntries=$NUM" >> $2.pls
for i in `find $1* -type f -name *.ogg`; do
echo "File${ct}=${ROOT}/${i}" >> $2.pls
ct=`expr $ct + 1`
done
}

# Do all the subdirectories
for j in `find * -type d -maxdepth 1`; do
BuildPlaylist $j $j
done

# Make a list for all of them
BuildPlaylist "" "all"


3. genplaylists.sh

* genplaylists.sh.txt

#!/bin/bash

BASEDIR=$1
if [ "$BASEDIR" == "" ]; then
echo You must specify a base directory
exit 1
fi

cd $BASEDIR
BASEDIR=`pwd`

# Remove existing playlists
find . -name '*.m3u'|sed -e "s/^/\"/"|sed -e "s/$/\"/"|xargs rm -f

# Remove funky Mandrake backup files
find . -name '*~'|sed -e "s/^/\"/"|sed -e "s/$/\"/"|xargs rm -f

find . -type d |sort| while read -r DIR; do
cd "$BASEDIR/$DIR"
find . -type f |grep -v m3u|sort> '00-Playlist.m3u'
done
 
Oben