Looping through the output of a command field by field
suggest changeLet’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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents