Why doesn't the process substitution <() work with ssh -F
The command:
ssh -F <(vagrant ssh-config) default
runs the vagrant
command in a separate process with its stdout connected to a pipe. The other end of the pipe is connected as file descriptor n
(in your case it's 11) to a new process that runs ssh
and the shell runs:
ssh -F /proc/self/fd/n default
Now, that only works if ssh
doesn't close its file descriptors on startup.
Unfortunately, it does.
If using zsh
, an alternative is to use the =(...)
form of process substitution where instead of using a pipe and /proc/self/fd
, it uses a temp file.
Or you could use a file descriptor that ssh
doesn't close. For instance, if you're not feeding anything to ssh
(if the remote command is not reading anything from stdin) you could use fd
0, e.g.:
vagrant ssh-config | ssh -F /dev/stdin -n default