Calling multiple bash functions in parallel

I read an example at http://www.gnu.org/software/parallel/man.html#example__calling_bash_functions , however, is it possible to use gnu to call functions 2 that have no variables do you go to them?

Example

a() { echo "download a" wget fileA } b() { echo "download b" wget fileB } 

and use parallel to call both functions a and b ?

+6
source share
2 answers

Run them in the 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 
+6
source

If you insist on using GNU Parallel:

 a() { echo "download a" wget fileA } b() { echo "download b" wget fileB } export -fa export -fb parallel ::: ab 
+5
source

All Articles