bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash-source closes file descriptor before reading from it on Darwin


From: Andrew de Andrade
Subject: bash-source closes file descriptor before reading from it on Darwin
Date: Tue, 17 Sep 2013 17:47:14 -0700

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: darwin12.4.0
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='darwin12.4.0' -DCONF_MACHTYPE='i386-apple-darwin12.4.0'
-DCONF_VENDOR='apple'
-DLOCALEDIR='/usr/local/Cellar/bash/4.2.45/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -DMACOSX   -I.  -I. -I./include -I./lib
-I./lib/intl -I/private/tmp/bash-NnFr/bash-4.2/lib/intl  -g -O2
uname output: Darwin Andrews-MacBook-Air.local 12.4.0 Darwin Kernel Version
12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64
x86_64
Machine Type: i386-apple-darwin12.4.0

Bash Version: 4.2
Patch Level: 45
Release Status: release

Description:
When using source with process substitution, where the command
 writes to stdout, source closes the file descriptor created by
the process substitution before reading from it.

AFAIK this only occurs on Darwin. This impacts bash-completion
used by npm and node-tabtab.
 https://github.com/isaacs/npm/blob/master/lib/completion.js#L163

Repeat-By:
Create a script or executable that writes another script to
stdout. Execute that command like so...
 source <(my_command)
... then check if the script written to stdout was actually
sourced.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]