Bash Read a file (data stream, variable) line-by-line (and/or field-by-field)? Looping through the output of a command line by line


Example

while IFS= read -r line;do
    echo "**$line**"
done < <(ping google.com)

or with a pipe:

ping google.com |
while IFS= read -r line;do
    echo "**$line**"
done