parallel
[Top][All Lists]
Advanced

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

Re: transfer with hostnames from stdin


From: Ole Tange
Subject: Re: transfer with hostnames from stdin
Date: Tue, 24 Nov 2015 22:20:42 +0100

On Sat, Nov 21, 2015 at 6:02 PM, Brian McQueen <mcqueenorama@gmail.com> wrote:
> This would be great for my current cloud setup:
>
> ./getIpsFromAPI | parallel --tag --nonall -S - --transfer fixThing.sh
>
> I want it to take the local file, transfer it and exec it in the usual way,
> but I want the filename as an arg to transfer, and the hostnames to come
> from stdin.  Is there a way to do that?

Getting the sshlogins from stdin is easy:

    ... | parallel --tag --nonall --slf - fixThings.sh

But it seems you have found a bug: --transfer does not work with
--(n)onall. Otherwise this ought to work (THIS DOES NOT WORK NOW):

    ... | parallel --tag --nonall -S - --transfer fixThings.sh :::
file1_to_transfer file2 3rd

--basefile works, though. So maybe you can use that as a work around.

    myfunc() {
        ... | parallel --tag --nonall -S - --basefile "$1" fixThings.sh
    }
    export -f myfunc
    parallel -j1 myfunc ::: file1_to_transfer file2 3rd

It is unclear to me whether it will be easy to get --transfer to work
with --nonall. Patch welcome.


/Ole



reply via email to

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