[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: expansion and redirections
From: |
Evan Gates |
Subject: |
Re: expansion and redirections |
Date: |
Thu, 3 Oct 2013 14:29:26 -0700 |
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.
>