[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
builtin read command fails with pipe input
From: |
Cristi Prundeanu |
Subject: |
builtin read command fails with pipe input |
Date: |
Sun, 20 May 2001 15:26:48 +0300 (EEST) |
Hello,
I have read the documentation over and over for the builtin 'read' command.
It should read and assign variables whether the standard input is a terminal
or a pipe. Well, the following has no effect on the content of variable
'testvar':
athos@sara:~$ echo '1 2 3' | read testvar
Is this a bug or did I understand something wrong?
I also tried echo -e '1 2 3\r' and echo -e '1 2 3\n' and had the same result.
The return code from read is 0 though, and read -t 3 returns immediately (no
timeout occurs).
Here is the output from bashbug regarding the machine configuration:
========
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -I. -I. -I./include -I./lib -I/usr/include -O2
-march=i386 -mcpu=i686
uname output: Linux sara.saratoga.ro 2.2.19-7.0.1 #1 Tue Apr 10 01:56:16 EDT
2001 i686 unknown
Machine Type: i386-redhat-linux-gnu
Bash Version: 2.04
Patch Level: 11
Release Status: release
=======
Regards,
Cristi Prundeanu
- builtin read command fails with pipe input,
Cristi Prundeanu <=