I have this folder structure.
myFolder
- script.sh
- test.txt
In my script.sh, I wrote this code:
filepath = "test.txt"
while read line || [ -n "$line" ]
do
this this this
done < filepath
I open terminal in myFolder
, I type bash script.sh
and I have this error:
No such file or directory
But test.txt
contains 1 line.
Why do I have this error?