shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Como fazer um bloco de comandos no laço ?


From: MrBiTS
Subject: Re: [shell-script] Como fazer um bloco de comandos no laço ?
Date: Wed, 29 Apr 2009 12:35:27 -0300
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leonardo Bites wrote:
> Alguem pode me ajudar em como fazer esse comando
> 
> cat ${DIR_ORIGEM}/arquivos|while read d; do {chmod 755 ${d} && mv ${d}
> ${DIR_DESTINO} && ls ${DIR_DESTINO}/${d} && if [ $? = 0 ]; then  rm
> ${DIR_ORIGEM}${d} fi} ; done
> 
> sem receber esse bedinto erro
> 
> bash: syntax error near unexpected token `done'
> 
> Não sei como colacar esse bloco de comandos já tentei colocar em função mas
> tambem não funcionou.
> 
> Valeu galera

No seu bloco:

cat ${DIR_ORIGEM}/arquivos|while read d; do {chmod 755 ${d} && mv ${d}
${DIR_DESTINO} && ls ${DIR_DESTINO}/${d} && if [ $? = 0 ]; then  rm
${DIR_ORIGEM}${d} ; fi} ; done

Faltou um ; antes do fi. Agora, por que dentro de um bloco ?


- --

Um abraço

.0. MrBiTs - address@hidden
..0 GnuPG  - 
http://keys.cardboard.net:11371/pks/lookup?op=get&search=0xAC37715A6DD1F186
000 http://www.mrbits.com.br

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkn4c78ACgkQrDdxWm3R8YYpngCcDE9cwj3vl0+fKnBLWqVNs9JZ
9WYAoIV0+cuo7REV61ozVMywq2hzYDlI
=cUcA
-----END PGP SIGNATURE-----


reply via email to

[Prev in Thread] Current Thread [Next in Thread]