Process command output line by line in a while loop
$ while read -r line; do echo $line; done < <(YOUR COMMAND HERE);
</p>
This snippet allows to process the output of any bash command line by line.
Diff your entire server config at ScriptRock.com
</div>
Read More here.