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

2010-12-15 Thread Cristian Ionescu-Idbohrn
This problem is a dash-bug which was originally reported to: http://bugs.debian.org/595063 and subsequently to d...@vger.kernel.org. The whole thread here: http://thread.gmane.org/gmane.comp.shells.dash/362 BusyBox v1.19.0.git (2010-12-12 17:35:28 CET) ash is affected by exactl

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

2010-12-15 Thread Ralf Friedl
Cristian Ionescu-Idbohrn wrote: $ ./busybox ash -c 'read MAX The difference is that bash does a larger read: bash: read(0, "32768\n", 128) = 6 ash: read(0, "3", 1) = 1 read(0, "", 1) = 0 The proc files are not regular files, imple

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

2010-12-15 Thread Bob Dunlop
Not a fix but a work around: > $ ./busybox ash -c 'read MAX 3 $ busybox ash -c 'MAX=$(cat /proc/sys/kernel/pid_max) ; echo $MAX' 32768 Files in /proc are generated on the fly. They can be fussy about how they are read. -- Bob Dunlop ___ bus

Re: read() builtin doesnt read integer value /proc files (but bashs does)

2010-12-15 Thread Cristian Ionescu-Idbohrn
On Wed, 15 Dec 2010, Bob Dunlop wrote: > > Not a fix but a work around: > > > $ ./busybox ash -c 'read MAX > 3 > > $ busybox ash -c 'MAX=$(cat /proc/sys/kernel/pid_max) ; echo $MAX' > 32768 > > > Files in /proc are generated on the fly. They can be fussy about how > they are read. Yes. Same sug