Re: patch for "bizarre read bug" in klibc dash

From: Alexander E. Patrakov
Date: Thu Jun 15 2006 - 01:01:43 EST


Joshua Hudson wrote:
Oh, and the original code that found this long ago:
grep MemFree /proc/meminfo | read J MEMFREE K
case $MEMFREE in
...
(MEMFREE used several times below)

Had to convert to:

MEMFREE=`grep MemFree /proc/meminfo | (READ J M K ; echo $M)`
case $MEMFREE in
...

Pure-shell implementation:

while read J M K ; do
case "$J" in
MemFree:)
MEMFREE="$M"
esac
done </proc/meminfo
case $MEMFREE in
...

--
Alexander E. Patrakov

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/