I am running a script like this:
while IFS=$'\r' read -r line || [[ -n "$line" ]]; do something done < "$1"
Basically, it reads a text file (as
$1) and "do something" for each line.
The text file has 20 lines. If I modify the text file now by adding a line (line 21) when the script is running and working on line 10, will it work on line 21 later?
In other words, how the script read the text file? Read the whole file at once at beginning, or each line one by one when necessary?