Bug 7475

Summary: "source" does not work in conjunction with "process substitution"
Product: Sisyphus Reporter: at <at>
Component: bashAssignee: placeholder <placeholder>
Status: RESOLVED LATER QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   
URL: http://lists.gnu.org/archive/html/bug-bash/2006-01/msg00018.html

Description at@altlinux.org 2005-07-28 05:49:57 MSD
Steps to Reproduce:
$ bash -ec 'cat <(echo echo 1)'
echo 1
$ bash -ec '. <(echo echo 1)'
$ bash -exc '. <(echo echo 1)'
+ . /dev/fd/63
$ ++ echo echo 1

Note that my command prompt is screwed in the last case, i.e. bash exited
before the process substitution was finished.



Expected Results:  
1
Comment 1 Dmitry V. Levin 2005-12-31 02:17:38 MSK
Same happens with bash-3.0
Comment 2 Dmitry V. Levin 2006-01-07 01:11:47 MSK
Same with bash-3.1.1.
Here is an explanation:

$ strace -e trace=file,desc bash -ec '. <(echo echo 1)'
[...]
stat64("/dev/fd/63", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("/dev/fd/63", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(3, "", 0)                          = 0
close(3)                                = 0
Comment 3 Dmitry V. Levin 2006-01-10 01:42:52 MSK
From Chet Ramey answer:
"The bash source builtin only works with regular files.
This is a limitation that will someday be lifted."

http://lists.gnu.org/archive/html/bug-bash/2006-01/msg00018.html