Bug 7475 - "source" does not work in conjunction with "process substitution"
: "source" does not work in conjunction with "process substitution"
Status: RESOLVED LATER
: Sisyphus
(All bugs in Sisyphus/bash)
: unstable
: all Linux
: P2 normal
Assigned To:
:
: http://lists.gnu.org/archive/html/bug...
:
:
:
  Show dependency tree
 
Reported: 2005-07-28 05:49 by
Modified: 2006-01-10 01:42 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-07-28 05:49:57
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 From 2005-12-31 02:17:38 -------
Same happens with bash-3.0
------- Comment #2 From 2006-01-07 01:11:47 -------
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 From 2006-01-10 01:42:52 -------
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