lkml.org 
[lkml]   [2006]   [Jun]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From"Alexander E. Patrakov" <>
SubjectRe: patch for "bizarre read bug" in klibc dash
DateThu, 15 Jun 2006 11:02:25 +0600
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-15 07:05    [from the cache]
©2003-2008