Le 19.02.2014 10:30, berenger.mo...@neutralite.org a écrit :
Le 19.02.2014 09:53, Scott Ferguson a écrit :
On 19/02/14 19:47, berenger.mo...@neutralite.org wrote:
Hello.

I made a script to extract music from a jamendo archive, but for a
reason I do not know, 7z does not accept the command line. I also echoed it, to be able to know what it tries to run, and it works fine when ran
on command line.

Here is the script:

#!/bin/sh

for i in *.zip;
do
    artiste=`echo $i|cut -f1 -d-|sed -e 's/^ *//g' -e 's/ *$//g'`
    album=`echo $i|cut -f2 -d-|sed -e 's/^ *//g' -e 's/ *$//g'`
    mkdir "$artiste/$album" -p
    7z x \"$i\" -o\"$artiste/$album\" || rmdir "$artiste/$album" -p
    echo 7z x \"$i\" -o\"$artiste/$album\"
done

With, for example, this archive:
http://www.jamendo.com/fr/list/a69778/monument, the folders are
correctly created, but it prints:
Error: Incorrect command line
7z x "Shearer - Monument - a69778 --- Jamendo - MP3 VBR 192k.zip"
-o"Shearer/Monument"

Do someone knows what I am doing wrong?



Maybe passing "-" without a recognised qualifier (after the
$artiste/$album\) ??

Kind regards

It does not change anything.

I have some "progress", when I do this:
7z x "\'$i\'" -o"\'$artiste/$album\'"
instead of
7z x \"$i\" -o\"$artiste/$album\"

But the the error become "there is no such archive". I wonder if the
easier would not be to try another unarchiver...

Ok, I have found the error, thanks to unzip and it's real error messages ( it does not just says "I failed", but it explains the reason, by giving what names it tried, which is the only good way to allow a user to understand what is the problem, imo. I may start to use it for real I guess. ).
The correct line is:
7z x "$i" -o"$artiste/$album"

I just wonder how it will behave if there are more exotic names... but I'll see that when I'll have the problem, for now it works. Thanks for help.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/a6ea1a7cd91aaa93846afccdb0941...@neutralite.org

Reply via email to