How to write to a named file descriptor in Bash?
The string inside the braces is just the name of a variable the shell will set for you, whose value is the file descriptor the shell allocates. The braces are not part of the name. In order to use it, just expand the variable in the proper context.
$ exec {out}>out$ echo foobar >&$out$ cat outfoobar
In your example, the file {out}
was created by
echo >&{out}
not the initial exec
whose redirection created the file out
stored the allocated file descriptor in the variable out
.