[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Call bash function in parallel
From: |
Peng Yu |
Subject: |
Call bash function in parallel |
Date: |
Wed, 25 Jan 2012 13:18:11 -0600 |
Hi,
I want to call a bash function by parallel. But it seems not possible.
I'm wondering if you have a number of commands that is inconvenient to
put in one line after 'parallel', what the solution should be. Wrap
this commands into a bash function seem to be a reasonable way. But it
doesn't work. Could anybody share your experience? Thanks!
$ cat main.sh
#!/usr/bin/env bash
(echo x; echo y;) | parallel echo "a{}"
function testing {
echo test$1
}
(echo x; echo y;) | parallel testing '{}'
--
Regards,
Peng
- Call bash function in parallel,
Peng Yu <=