Kb valami ilyesmi kellene neked (az, hogy a while feltetele a read, arra jó, hogy end-of-file (ctrl+D vagy tényleges eof, ha pl egy pipe-ból jön az input) esetén is megszakadjon a ciklus):
function read_line()
{
while read LINE ; do
if [ -z "$LINE" ] ; then
return
fi
echo "--- $LINE ---"
done
}
DRM is theft