# WEBPAGE LINKS FILE PATH
# (OPTIONAL) KEYWORD TO LOOK FOR
if [[ ! -f $links_file ]]; then
printf '« %s »: no such file found.\n' "$links_file" >&2
while [[ ! $keyword ]]; then
read -rp 'Enter a keyword to look for: ' keyword
while read -r; do
if grep -qi "$keyword" < <(wget -qO- "$REPLY"); then
printf 'Keyword found on: %s\n' "$REPLY"
done < "$links_file"
In a WHILE loop, what's mean to do: "done < myfile" at the end?done < myfile
is equivalent to done 0< myfile
There isn't any connection with the while
It redirects the file descriptor 0, which is the standard input, to the file myfile
becomes the standard input instead of your keyboard, then it reads from it.
0 is the standard input by convention. It just is an abstract indicator to work with.
Just remember it as being your keyboard.