Bash Looping through the output of a command field by field


Example

Let's assume that the field separator is :

while IFS= read -d : -r field || [ -n "$field" ];do
    echo "**$field**"
done < <(ping google.com)

Or with a pipe:

ping google.com | while IFS= read -d : -r field || [ -n "$field" ];do
    echo "**$field**"
done