Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm writing a script to read a simple text file.

But I get only a "No such file" message.

The file exist and has proper access rigths

the code I'm using is:

Ficheiro="mensagem"
while read linha; do
    echo $linha
done < Ficheiro
share|improve this question
1  
you may get the same error message even after including the $ sign, if your file isnt in the same directory. You might try specifying the absolute path. –  j0h May 6 '13 at 16:16
add comment

1 Answer

You are missing a $

done < $Ficheiro
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.