Split a Linux pipe
The command is tee
and the syntax is:
cat ... | tee >(one) >(two)
For example, for same url, we want to request it with both curl
and curl --user-agent 'Mobile'
:
cat urls \
| tee \
>(parallel --load 8 -j 8 -q curl -H "Cache-Control:max-age=0" \
-s -w %{url_effective}:%{http_code}:%{time_total}'\n' -o /dev/null) \
>(parallel --load 8 -j 8 -q curl -H "Cache-Control:max-age=0" --user-agent "Mobile" \
-s -w %{url_effective}:%{http_code}:%{time_total}'\n' -o /dev/null)