Re: redirections preceded by a word with builtins inconsistent
From:
Greg Wooledge
Subject:
Re: redirections preceded by a word with builtins inconsistent
Date:
Mon, 23 May 2016 09:37:37 -0400
User-agent:
Mutt/1.4.2.3i
On Sun, May 22, 2016 at 09:48:47PM +0300, adonis papaderos wrote:
> > > When using redirections preceded by a word on builtins
> > > 'i.e. : {varname}<&1'
> > > the redirection persists to the current shell.
That surprises me, but if Chet says it's not a bug, then so be it.
Simply stop doing it. It's not good shell code. If you want to open
or close an FD for the current shell, use exec.
exec {varname}<&1
exec {varname}<&-