I don’t understand this line:
exec {logOutFd}>&1 {logErrFd}>&2
There are no variable dereferences, and it seems to be just a no-op, like running exec with no parameters. What’s going on?
>Solution :
exec with no parameters is used to start redirections that last for the rest of the script.
From the Bash manual section on redirection:
Each redirection that may be preceded by a file descriptor number may instead be preceded by a word of the form {varname}. In this case, for each redirection operator except
>&-and<&-, the shell will allocate a file descriptor greater than 10 and assign it to {varname}.
So this is duplicating stdout and stderr to new file descriptors, and setting the variables $logOutFd and $logErrFd to these descriptors, respectively.
This allows later code that executes while stdout or stderr are redirected to write to the original stdout or stderr, with
echo stdout message >&$logOutFd