parallel call multiple bash functions parallel call multiple bash functions bash bash

parallel call multiple bash functions


Run them in background. And then wait for them to complete.

a() {  echo "download a"  wget fileA}b() {  echo "download b"  wget fileB}a &b &wait # waits for all background processes to complete


If you insist on using GNU Parallel:

a() {  echo "download a"  wget fileA}b() {  echo "download b"  wget fileB}export -f aexport -f bparallel ::: a b

If you need read access to variables in the shell you can either export the variables or use env_parallel.