hey

a velha dica de alteração do IFS não funfa? Tente setar o IFS como
quebra de linha antes de trabalhar com os nomes dos arquivos dentro do
seu script

IFS="
"

(vide exemplo em
http://www.mail-archive.com/[email protected]/msg05769.html)

hasta!

jr.

On 4/4/07, Christian Andreas Miniero Casza <[EMAIL PROTECTED]> wrote:
> Maurício,
>
> utilize o sed para converter '\ ' em '\\\ ' no nome do arquivo.
> Seria: sed 's/\ /\\\ /g'.
>
> Isso deve resolver seu problema.
>
> On Wed, 4 Apr 2007 08:13:49 -0300, "Mauricio Vieira" <[EMAIL PROTECTED]> 
> wrote:
> > Olá a todos,
> >
> >  Fiz um pequeno script para converter arquivos ogg pra mp3 (a partir desta
> > msg, é domínio público).
> >
> > #!/bin/sh
> >
> > [ -z $1 ] && exit 1
> >
> > ARQUIVOOGG=$1
> > EXTENSION=${ARQUIVOOGG:${#ARQUIVOOGG}-4:4}
> > #echo $EXTENSION
> > [ $EXTENSION == '.ogg' ] || exit 1
> >
> > ARQUIVOMP3=${ARQUIVOOGG%.ogg}".mp3"
> > ARQUIVOMP3=${ARQUIVOOGG/ogg/mp3}
> >
> > COMANDO="oggdec \"${ARQUIVOOGG}\" -o - | lame - \"${ARQUIVOMP3}\""
> > echo $COMANDO
> > $COMANDO
> >
> > Acontece que os arquivos mp3 contém espaços no nome.
> > Um exemplo:
> >
> > sh -x ~/bin/ogg2mp3.sh 07\ -\ Once\ Upon\ The\ Sea\ Of\ Blissful\
> > Awareness.ogg
> > + '[' -z 07 - Once Upon The Sea Of Blissful Awareness.ogg ']'
> > /home/vieira/bin/ogg2mp3.sh: line 3: [: too many arguments
> > + ARQUIVOOGG='07 - Once Upon The Sea Of Blissful Awareness.ogg'
> > + EXTENSION=.ogg
> > + '[' .ogg == .ogg ']'
> > + ARQUIVOMP3='07 - Once Upon The Sea Of Blissful Awareness.mp3'
> > + ARQUIVOMP3='07 - Once Upon The Sea Of Blissful Awareness.mp3'
> > + COMANDO='oggdec "07 - Once Upon The Sea Of Blissful Awareness.ogg" -o -
> > |
> > lame - "07 - Once Upon The Sea Of Blissful Awareness.mp3"'
> > + echo oggdec '"07' - Once Upon The Sea Of Blissful 'Awareness.ogg"' -o -
> > '|' lame - '"07' - Once Upon The Sea Of Blissful 'Awareness.mp3"'
> > oggdec "07 - Once Upon The Sea Of Blissful Awareness.ogg" -o - | lame -
> > "07
> > - Once Upon The Sea Of Blissful Awareness.mp3"
> > + oggdec '"07' - Once Upon The Sea Of Blissful 'Awareness.ogg"' -o - '|'
> > lame - '"07' - Once Upon The Sea Of Blissful 'Awareness.mp3"'
> > OggDec 1.0.1
> > ERROR: Can only specify one input file if output filename is specified
> >
> > Se eu pego a saida do meu 'echo' e colo no terminal, ele executa
> > corretamente. Exemplo:
> > oggdec "07 - Once Upon The Sea Of Blissful Awareness.ogg" -o - | lame -
> > "07
> > - Once Upon The Sea Of Blissful Awareness.mp3"
> >
> > Só que dentro do script, ele não tá encarando assim. Já tentei
> > _escapar_ com
> > aspas, mas não tá funcionando. Alguém quem alguma sugestão?
> >
> > agradeço antecipadamente (pra não encher a lista com msgs de
> > agradecimento)
> >
> > --
> > Mauricio B. C. Vieira
> > http://mauriciovieira.net
> >
> >
> > [As partes desta mensagem que não continham texto foram removidas]
> >
> >
> >
> --
> Christian Andreas Miniero Casza
> Administrador de Sistemas
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> +55 11 8173-7882
> +55 11 5643 7846
>
>
>
> ---------------------------------------------------------------------
> Esta lista não admite a abordagem de outras liguagens de programação, como 
> perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio 
> aviso.
> ---------------------------------------------------------------------
> Sair da lista: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> Esta lista é moderada de acordo com o previsto em 
> http://www.listas-discussao.cjb.net
> ---------------------------------------------------------------------
> Servidor Newsgroup da lista: news.gmane.org
> Grupo: gmane.org.user-groups.programming.shell.brazil
>
>
> Links do Yahoo! Grupos
>
>
>

Responder a