Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Backgrounding part of 'ssh-agent $cmd'



On Jan 18,  4:13pm, Daniel Shahaf wrote:
>
> The part that I find less than ideal so far is that, under load, the GUI
> ssh-askpass dialog appears after foo_main has started.

You could do it like this:

  ( # Subshell so caller's environment won't be changed; could instead
    # declare locals, but this is immune to changes in ssh-agent
    eval `ssh-agent`
    ssh-add ~/.ssh/foo.id_rsa
    {
      for h in host1 host2 host3; do 
        ssh -MNf $h &
      done
      wait
    } always {
      ssh-agent -k
    } &
  )

Then you don't have to background foo_ssh_preseed, and your preferred
order of events is retained.

> > Am I missing something?
> 
> 'ssh -MNf' daemonizes itself

Ah, of course.



Messages sorted by: Reverse Date, Date, Thread, Author