So I have a while loop:cat live_hosts | while read host; do \    sortstuff.sh -a $host > sortedstuff-$host; doneBut this can take a long time. How would I use GNU Parallel for this while loop?
How would I use GNU Parallel for this while loop?
shell script;files;gnu parallel
You don't use a while loop.parallel sortstuff.sh -a {} > sortedstuff-{} <live_hostsNote that this won't work if you have paths in your live_hosts (e.g. /some/dir/file) as it would expand to sortstuff.sh -a /some/dir/file > sortedstuff-/some/dir/file (resulting in no such file or directory); for those cases use {//} and {/} (see gnu-parallel manual for details):parallel sortstuff.sh -a {} > {//}/sortedstuff-{/} <live_hosts