Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15016

Re: Reading from a file by using its FD returns its contents only once

From Tadeus Prastowo <tadeus.prastowo@unitn.it>
Newsgroups gnu.bash.bug
Subject Re: Reading from a file by using its FD returns its contents only once
Date 2018-12-31 17:40 +0100
Message-ID <mailman.6624.1546274433.1284.bug-bash@gnu.org> (permalink)
References <CACosJgxBTuPp9KpUuT5nST9dB7uFqP2gJ31q76C8O9owRU7_iw@mail.gmail.com>

Show all headers | View raw


On Mon, Dec 31, 2018 at 2:37 AM mike b <michallinuxstuff@gmail.com> wrote:

[...]

> The above is just an example. Doing reads on any other regular file like
> this yields same behavior:
> # echo bla >./t
> # exec 10<./t
> # read -r <&10
> # echo $REPLY
> bla
> # read -r <&10
> # echo $REPLY

That's correct behavior because the second `read -r' already hits an
EOF, isn't that?

--
Best regards,
Tadeus

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Reading from a file by using its FD returns its contents only once Tadeus Prastowo <tadeus.prastowo@unitn.it> - 2018-12-31 17:40 +0100

csiph-web