John Lewis John Lewis - 1 year ago 97
Bash Question

How can I split result from xargs?

I am trying to split the lines that I get from the following command but it's not being split at new line. How to do it?

seq 0 1 5000 | xargs -n 5 -I{} -P 5 -- curl -s -o /dev/null -w "%{http_code} %{url_effective}" "{}.txt" >> result.txt

Answer Source

Put a \n in your format string if you want each result to be on its own line:

-w '%{http_code} %{url_effective}\n'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download