On Fri, Aug 21, 2015 at 4:01 AM, sosogh <sos...@mail.com> 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