busybox 1.5.x ash read builtin only reads one character at a time?

Luciano Rocha strange at nsk.no-ip.org
Thu May 24 16:48:14 UTC 2007


On Thu, May 24, 2007 at 11:50:35AM -0400, Clem Taylor wrote:
> On 5/24/07, Paul Fox <pgf at brightstareng.com> wrote:
> > ash is certainly doing character-at-a-time reads.  looking at the
> > bash code, it appears to do buffered input if it can.  (though
> > it's not clear to me it will always get a whole line -- i.e., i
> > think it would break if the /proc entry were quite long.)  i
> > assume you've tried this with bash, and it works?  it's
> > non-trivial to fix, since the current algorithm in ash handles
> > the -n and -t options trivially.
> 
> Yeah it works with bash, but I'm not about to put bash on my embedded
> system :-). I agree that this is not an ash bug, reading one byte at a
> time seems perfectly reasonable to me. The problem is an unexpected
> behavior of /proc. Some /proc entries work just fine, the problem may
> be isolated to /proc/sys files.

Actually, bash has some problems with /proc, too. The startup scripts in
RedHat use explicitly cat instead of read or $(< file) because of that.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070524/2d24332f/attachment-0002.pgp 


More information about the busybox mailing list