Bug 7475 - "source" does not work in conjunction with "process substitution"
Summary: "source" does not work in conjunction with "process substitution"
Status: RESOLVED LATER
Alias: None
Product: Sisyphus
Classification: Development
Component: bash (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL: http://lists.gnu.org/archive/html/bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-28 05:49 MSD by at@altlinux.org
Modified: 2006-01-10 01:42 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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