bug-bash
[Top][All Lists]
Advanced

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

Re: FIFO silently ignored on . ( `source´ ) command


From: Chet Ramey
Subject: Re: FIFO silently ignored on . ( `source´ ) command
Date: Mon, 12 Dec 2011 09:05:09 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 12/12/11 7:54 AM, Timothy Madden wrote:

> I have
>     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) on an
> up-to-date CentOS 5.7 (Final) x64,
> and
>     GNU bash, version 4.1.10(4)-release (i686-pc-cygwin) on Windows 7 x64 SP1.
> 
> In both OSes I noted that `source´ built-in does not work on a FIFO. On
> CentOS the command is just ignored, and on cygwin it blocks indefinitely (I
> guess).  Ok, cygwin FIFOs may not be a good test case, but  I think CentOS
> ones are.

This was changed about five years ago, before bash-4.0 was released.

> Here is my test example
> 
> [root@appserver2 ~]# mkfifo /tmp/myfifo
> [root@appserver2 ~]# echo ls -l >/tmp/myfifo &
> [2] 23771
> [root@appserver2 ~]# source /tmp/myfifo        # no `ls´ output here...
> [root@appserver2 ~]# rm /tmp/myfifo
> rm: remove fifo `/tmp/myfifo'? y
> [2]+  Exit 1                  echo ls -l > /tmp/myfifo
> [root@appserver2 ~]#

This is a less-than-ideal example, since it attempts to execute the
`ls -l' output as commands.  Replacing the `ls -l' with `echo hello world'
results in `hello world' on bash-4.0, bash-4.1, and bash-4.2 on Mac OS X
and RHEL 5.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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