'MacOS BASH, Get output from networkQuality command running in background

I am trying to launch networkQuality command in the background and live fetch the first part of the output to the bash script launching it.

First part I want to fetch from the background command:

current download capacity: 49.342 Mbps - current upload capacity: 52.951 Mbps

Code:

networkQuality &

When the command have finished in the background I also want to fetch the result:

==== SUMMARY ====
Upload capacity: 68.877 Mbps

Download capacity: 67.388 Mbps

Upload flows: 16

Download flows: 20

Anyway of doing this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source