Find the answer to your Linux question:
Results 1 to 6 of 6
hi ! I'm french, excuse me for my bad english I have a pb with this script and I don't knaow why ? can you help me .? #!/bin/bash test[0]="/home/stuff/test/03 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    4

    Pb bash with lame


    hi !

    I'm french, excuse me for my bad english

    I have a pb with this script and I don't knaow why ?
    can you help me .?

    #!/bin/bash

    test[0]="/home/stuff/test/03 le voisin.wav"
    test[1]="/home/stuff/test/test2/01 Le Chien Mouille (En Silence).wav"
    test[2]="/home/stuff/test/test2/02 A Table.wav"

    for ((i=0;$i<${#test[*]};i++))
    do
    echo ${test[$i]}
    name=` echo ${test[$i]} | awk -F "." '{print $1}'`
    echo $name
    cmd_lame="--verbose \"$nom.wav\" \"$nom.mp3\" "
    echo "$cmd_lame"
    lame $cmd_lame

    done

    This is the error message :

    lame: excess arg Table.wav"
    LAME version 3.96.1 (http://lame.sourceforge.net/)(...)

    usage: lame [options] [outfile]

    and/or can be "-", which means stdin/stdout.

    Try:
    "lame --help" for general usage information
    or:
    "lame --preset help" for information on suggested predefined settings
    or:
    "lame --longhelp"
    or "lame -?" for a complete options list

  2. #2
    Just Joined!
    Join Date
    Feb 2005
    Location
    Delft, Holland
    Posts
    95
    I think placing a '\' character in front of the spaces might help:

    Code:
    test&#91;0&#93;="/home/stuff/test/03\ le\ voisin.wav"
    test&#91;1&#93;="/home/stuff/test/test2/01\ Le\ Chien\ Mouille\ &#40;En\ Silence&#41;.wav"
    test&#91;2&#93;="/home/stuff/test/test2/02\ A\ Table.wav"
    This will make sure that the words like 'le' and 'voisin' are not seen as seperate arguments to the program.

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    4

    re

    first of all thx to your answer ...

    I had already think to add '\' charactere but it the seem pb

    I don't know why it doesn't work :S

    thx a lot ...

  4. #4
    Just Joined!
    Join Date
    Mar 2005
    Location
    India
    Posts
    11
    Mr. bashful, the line

    cmd_lame="--verbose \"$nom.wav\" \"$nom.mp3\" "
    i think $nom is actually $name , right?

    ok, u can try enclosing $name in " " i.e "$name" . dont put any "\" in test[1],test[2] etc..

    does that help?

  5. #5
    Just Joined!
    Join Date
    Apr 2005
    Posts
    4

    re

    Thanks a lot sandy_007 for your answer, but I have already try that and it doesn't work too.
    I don't understand why it doesn't work.? if anybody can help me it wiil be nice.

    Excuse me for my bad english, I hope that all understand what I say.

    Thanks.

  6. #6
    Just Joined!
    Join Date
    Apr 2005
    Posts
    4
    Hi !

    I 'have fnd the probleme, it was juste :

    Code:
    bash -c "lame --verbose $cmd_lame"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •