parallel
[Top][All Lists]
Advanced

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

Re: use parallel for ssh -tt "xxxx"


From: Ole Tange
Subject: Re: use parallel for ssh -tt "xxxx"
Date: Sun, 23 Aug 2015 06:05:36 +0200

On Fri, Aug 21, 2015 at 4:01 AM, sosogh <address@hidden> wrote:

> without -tt in ssh ,everything goes well:
>  parallel    -a   iplist.txt   ' ssh -q {}  "whoami" '
>
>  but with -tt , parallel will not exit , it will freeze there when finishing
> the last job.
>  parallel    -a   iplist.txt   ' ssh -qtt  {}  "sudo whoami"   '
>
>  why I need -tt is to work around  "ssh sudo: sorry, you must have a tty to
> run sudo".

The work around is:

    parallel -a iplist.txt 'ssh -qtt {} "sudo whoami" </dev/null'
    parallel -a iplist.txt 'ssh -qtt {} "sudo whoami"' </dev/null
    cat iplist.txt | parallel 'ssh -qtt {} "sudo whoami"'

The reason for your problems is due to the first job gets STDIN as its
controlling tty (from man parallel):

                stdin (standard input) will be passed to the first process run.

I seem to remember it was implemented to be compatible with some xargs
situation.


/Ole



reply via email to

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