On 5/21/16 5:16 PM, adonis papaderos wrote: > Bash Version: 4.3 > Patch Level: 42 > Release Status: release > > Description: > When using redirections preceded by a word on builtins > 'i.e. : {varname}<&1' > the redirection persists to the current shell.
This is by design, and has been discussed previously. One such discussion starts at http://lists.gnu.org/archive/html/bug-bash/2016-01/msg00156.html. Maybe it should only do it when preceded by `exec', but it never has. > Later using {varname}<&- does not close fd. You don't precede it with an `exec', so it doesn't affect the current shell. So-called `null' commands with redirections are executed in subshells. This is where you need the `exec'. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/