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

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

Re: [shell-script] bash - unexpected end of file


From: Tiago Barcellos Peczenyj
Subject: Re: [shell-script] bash - unexpected end of file
Date: Fri, 31 Aug 2007 09:19:06 -0300

Faça um  cat -A arquivo

Se vc ver uns ^M no fim de alguma linha, é o formato de final de linha
do arquivo, que está com o final do windows \r\n e o bash esta
esperando que seja apenas \n (vc escreveu no cygwin e esta executando
no unix?)

enfim, para corrigir é facil

sed -i.old 's/\r$//' arquivo

ou use o dos2unix ;-)

On 8/31/07, Mÿffffe4rcio Borges <address@hidden> wrote:
>
> Pessoal to precisando fazer um pequeno trabalho com o CYGWIN e pq tomo este 
> erro ?
>
>    #!/bin/bash
>  answer=y
>  while [ $answer = y ]; do
>      echo "Hello";
>      echo "go again?";
>      read answer
>  done
>
>
>    execucao:
>    + answer=$'y\r'
>  ./Loop.sh: line 7: syntax error near unexpected token `done'
>  ./Loop.sh: line 7: `done'
>
>    Grato
-- 
Tiago B Peczenyj
Linux User #405772

http://peczenyj.blogspot.com/


reply via email to

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