Re: read() builtin doesn't read integer value /proc files (but bash's does)

2010-09-04 Thread Steve Schnepp
2010/9/3 Jilles Tjoelker jil...@stack.nl: This patch assumes that the file descriptor is discarded afterwards (its position does not matter). Therefore the very common construct  while read x; do    ...  done stops working. Ohh.. thanks for that, I didn't see it. Actually while read x

Re: read() builtin doesn't read integer value /proc files (but bash's does)

2010-09-04 Thread Jilles Tjoelker
On Sat, Sep 04, 2010 at 08:20:33PM +0200, Steve Schnepp wrote: 2010/9/3 Jilles Tjoelker jil...@stack.nl: This patch assumes that the file descriptor is discarded afterwards (its position does not matter). Therefore the very common construct  while read x; do    ...  done stops

Re: read() builtin doesn't read integer value /proc files (but bash's does)

2010-09-03 Thread Steve Schnepp
2010/9/2 Jilles Tjoelker jil...@stack.nl: Thanks for your prompt reply. Note that a change in the file between the single-byte reads will cause an inconsistent value to be read. This is also the case with regular files on a filesystem, so it is acceptable. Are you implying that: - if the

Re: read() builtin doesn't read integer value /proc files (but bash's does)

2010-09-02 Thread Steve Schnepp
2010/9/1 Steve Schnepp steve.schn...@gmail.com: conforming to POSIX isn't a realistic option, would it be possible to have a workaround that doesn't involve an external tool like cat(1) ? Hi, I just hacked attached a little patch away to be able to solve this case. Feel free to reply with your