что надо делать в директории?
история такая... имеется папка с музыкой (Music) в ней лежат подкаталоги с исполнителями, в них еще подкаталоги (типа концерты, синглы и проч.) а в них уже альбома, а там уже музыка в *.ape + *.cue....
ну и идея:
1) даю ему каталог музыки (допустим zenity --file-selection --directory)
2) и тут он начинает последовательно входить в каталоги и искать наличие файлов *.ape + *.cue
нашел - ура выполняем:
iconv -fcp1251 -tutf8 *.cue -o utf.cue
./cueape.sh *.ape utf.cue -m
cp /output/*.mp3 ./
rm /output/ *.cue *.ape *.log
не нашел - идем дальше...
вот и все... в итоге 2Тб музыки переконверитится в мр3, а все лишнее удалиться..
просто в каждую папку в ручную заходить - клаву, наверное, сломаю)))
ЗЫ: команды копирования я написал просто-так не задумываясь над синтаксисом и проч.. только идею передать...
Пользователь решил продолжить мысль [time]Wed Nov 3 15:56:47 2010[/time]:
ну и, конечно, надо будет закинуть скрипт "cueape.sh" в /usr/bin
Пользователь решил продолжить мысль [time]Thu Nov 4 08:29:27 2010[/time]:
Я пока навоял мини-скриптик с выбором одного каталога и выполнением всех необходимых действий:
#! /bin/bash
# Получаем имя исходной директории
Dir=`zenity --file-selection --directory --title='Выберите директорию с музыкой, которую надо перекодировать'`
cd "$Dir"
# перекодирование *.cue файла в utf8
iconv -fcp1251 -tutf8 *.cue -o utf.cue
# переколировка в *.мр3
cueape *.ape utf.cue -m
# возвращаемся в исходную директорию
cd "$Dir"
# удаляем от туда все файлы
rm *
# перемещаем *.мр3 файлы в исходный каталог
mv "$Dir"/Output/* "$Dir"
# удаляем временный каталог
rm -r Output
До его выполнения в каталоге вот это:
~/2010 - Сингл (CD Maximum)$ ls
Scan Singl.ape Singl.cue Singl.log
После:
~/2010 - Сингл (CD Maximum)$ ls
1 - Твердый знак.mp3 2 - В путь.mp3 3 - Работа.mp3 Scan
Если пригодиться, то вот скрипт cueape:
/usr/bin$ cat cueape
#!/bin/bash
#cueape 0.1
#This script is intended to convert ape or flac + cue files to
#ogg vorbis or mp3 files, setting the tags to the correct value,
#obtained from the cue file.
#REQUIREMENTS:
# -Oggenc installed (it comes with vorbis-tools) if you want to encode into Ogg Vorbis.
# -lame installed if you want to encode into mp3
# -mac to decode ape files (Monkey's Audio)
# -flac to decode flac files.
#IF YOU FIND A BUG OR HAVE A SUGGESTION COMMENTO OR SIMPLY WANT TO CONTACT ME PLEASE MAIL ME TO
#rafadev_*@gmail.com REMOVING THE "_*"
#This is done to prevent spamming
#Copyright (C) 2006 Rafael Ponieman - Buenos Aires, Argentina
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#scripted by deX
case "$1" in
*.[aA][pP][eE] | *[fF][lL][aA][cC] )
if [ ! -f "$1" ] ; then
echo "Input file $1 doesn't exist"
exit 1
fi
if [ ! -f "$2" ]; then
echo "Cue input file $2 doesn't exist"
exit 1
fi ;;
* )
echo "Error: invalid input parameters"
exit ;;
esac
#Testing parameters
if [ "$3" != "-m" ] && [ "$3" != "-o" ] ; then
echo -en "�33[1;31mInvalid parameters
"
echo -en "�33[1;37m"
echo -en "Usage: cueape [input ape file] [input cue file] [parameters]
Parameters can be: -m for mp3 encoding or -o for ogg encoding.
"
exit 1
fi
#Need help with this one, coudn't solve it. I need to know how to check if a
#program actually exists and is accesible
#Checking for mac
#[ -f $(which 'maca' >> /dev/null) ] || {
# echo -en "�33[1;31mYou must have mac in your PATH.�33[1;37m
Please install Monkey's Audio Codec
You can get it from http://sourceforge.net/projects/mac-port/
"
#}
#Saving the position so as to return afterwards
olddir="$(pwd)"
#Going to target directory
cd "$(dirname "$1")"
#Checking for the output folder. If it's not there I create it
[ ! -d "Output" ] && mkdir -p "Output"
cp "$2" "Output/"
#Decompress
echo -en "
Cueape 0.1
"
echo -en "�33[1;32mStarting conversion
"
#Checking filetype by extension and decompressing
tmp="$(basename "$1")"
tmp="${tmp##*.}"
case "$tmp" in
[fF][lL][aA][cC] )
echo -en "�33[1;32mDecompressing FLAC file
"
echo -en "�33[1;37m"
tm="$(basename "$1")"
tm="${tm%.[fF][lL][aA][cC]}"
out="$(flac "-d" "$1" -o "Output/${tm}.wav" )"
;;
[aA][pP][eE] )
echo -en "�33[1;32mDecompressing APE file
"
echo -en "�33[1;37m"
tm="$(basename "$1")"
tm="${tm%.[aA][pP][eE]}"
out="$(mac "$1" "Output/${tm}.wav" "-d")"
;;
* )
echo "Error: line 99"
esac
cd "Output"
echo -en "�33[1;32m
Decompression finished
"
echo -en "�33[1;32mStarting reencoding
"
echo -en "�33[1;37m"
if [ "$3" = "-o" ] ; then
#Calling oggenc. Saving output for future checking
out="$(oggenc -q 6 -o "$tm.ogg" "$tm.wav")"
echo -en "�33[1;32m
Reencoding finished
"
echo -en "�33[1;32mSplitting
"
echo -en "�33[1;37m"
out="$(mp3splt -c "$(basename "$2")" -o "@n+-+@t" "$tm.ogg")"
else
#Calling lame. Saving output for future checking
out="$(lame --preset standard "$tm.wav" "$tm.mp3")"
echo -en "�33[1;32m
Reencoding finished
"
echo -en "�33[1;32mSplitting
"
echo -en "�33[1;37m"
#Using framemode becaus this settings are for VBR
out="$(mp3splt -f -c "$(basename "$2")" -o "@n+-+@t" "$tm.mp3")"
fi
echo -en "�33[1;32m
Processing finished successfully
"
echo -en "�33[1;37m"
# последние строки добавилсам
rm $tm.mp3
rm $tm.wav
rm *.cue
exit 0
Вот.... Но это только чуть-чуть облегчает жизнь: все равно надо каждые 15-20 секунд запускать скрипт и указывать новую директорию

Я думал, например, сделать:
find /dir/ -type d -exec ls {} \; | grep .cue
а вывод занести в масиив
затем цикл с количеством шагов, равным количеству элементов в массиве
в нем просто последовательно он бы входил в директорию с данными файлами,
но я не осознал,как в баше массив создать..