bash4 - bash: iterating through txt file lines can't read last line -
while read p; do
echo $p
done < file.txt
this code can read lines in file.txt except last line ideas why. thanks
if youre in doubt last \n
in file, can try:
while read p; echo $p done < <(grep '' file.txt)
grep not picky line endings ;)
you can use grep . file.txt
skipping empty lines...
Comments
Post a Comment