[Top][All Lists]

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

problem with builtin 'read' and standard input

From: Matthew Walker
Subject: problem with builtin 'read' and standard input
Date: Tue, 27 Jul 2004 21:55:46 +1200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510


I'm trying to redirect data to the builtin 'read'. I've no idea what's going wrong!

I believe this command
  echo "hello" | read myvar
should put "hello" into $myvar.  But $myvar is blank after execution.

If I type
  read myvar
and then type
then I get "hello" in $myvar.

What am I doing wrong?!?  Is this a bug?

I'm using Fedora Core 2. "bash --version" returns "GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)". I'm have the same problem in another system "GNU bash, version 2.05a.0(1)-release (i686-pc-linux-gnu)".

Totally confused,

Matthew Walker.

reply via email to

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