bash: xargs passing variable
With GNU Parallel you can avoid some of the quoting:
TEST=hallo2echo "hallo" | parallel echo passed={} test=$TEST
GNU Parallel exists as package for most distributions and it is recommended to use the normal package manager for installation. But if there is no package for your system, it still takes literally 10 seconds to install GNU Parallel.
Watch the intro videos to learn more: https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1