The correct syntax for that is
exec {VAR}<&-
-emg
On Wed, Oct 2, 2013 at 7:25 AM, Telychko <telychko@programist.ru> wrote:
> Hi.
>
> Recently i found this feature(or bug):
>
> its reproduce interactively
>
> $exec 3</dev/zero # open /dev/zero on 3
> $VAR=3 # have some variable with file descriptor
> $exec $VAR<&- # trying to close previously opened file descriptor
> bash: exec: 3: not found
>
> so we have expansion $exec $VAR<&- --> $exec 3 <&- ... why not $exec 3<&-
>
> $exec 3<&- # close normally
>
> Best regards.
>