This script was posted as answer to a [Question](https://unix.stackexchange.com/questions/113812/run-a-parallel-command-while-waiting-for-ssh/113822?noredirect=1#comment176211_113822).
And I'm trying to work out what's going on.

```
result=$(
  {
    {
      ssh host app-status >&3 3>&-; echo "$?"
    } | {
      until read -t1 ret; do
        printf . >&2
      done
      exit "$ret"
    }
  } 3>&1
)

```

Here's my explanation, but I'm sure it's wrong.

1. The outer `{...} 3>&1` : fd 3 is opened as a duplicate of stdout
2. Then second half of pipe, '| { }` no redirection
3. In read loop printf's stdout is duplicated with stderr, so in 2. (above) all output actually comes via stderr.
4. Now the first half of pipe, `{ ssh ... } |` : stdout of ssh is dupped onto fd3 (which is in fact stdout from 1. fd 3 is closed with `3>&-` so stdout is re-opened onto what it was originally and this is piped into 2.
5. finally, `echo` just prints to stdout

So my question (problem with understanding) is; Is the result of this the same as just printf to stderr ? What does the *voodo* redirect to 3 actually achieve?
Is there anything asynchronous in here ?