parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call bash function in parallel


From: Ole Tange
Subject: Re: Call bash function in parallel
Date: Fri, 27 Jan 2012 00:21:29 +0100

Wow, I did not know that. The man page for GNU Parallel has to be updated.

Is there a way to do that for an alias, too?


/Ole

On Thu, Jan 26, 2012 at 5:33 PM, Cook, Malcolm <MEC@stowers.org> wrote:
> export -f testing
>
> ~Malcolm
>
>
>> -----Original Message-----
>> From: parallel-bounces+mec=stowers.org@gnu.org [mailto:parallel-
>> bounces+mec=stowers.org@gnu.org] On Behalf Of Peng Yu
>> Sent: Wednesday, January 25, 2012 1:18 PM
>> To: Parallel@gnu.org
>> Subject: Call bash function in parallel
>>
>> 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
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]