We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53d8a99 commit 77d0e8dCopy full SHA for 77d0e8d
explorer/memory
@@ -89,10 +89,12 @@ in
89
then
90
# Use memory blocks if the architecture (e.g. x86, PPC64, s390)
91
# supports them (they denote physical memory)
92
- num_mem_blocks=$(cat /sys/devices/system/memory/memory[0-9]*/state | grep -cxF online)
93
mem_block_size=$(cat /sys/devices/system/memory/block_size_bytes)
94
-
95
- echo $((num_mem_blocks * 0x${mem_block_size})) | bytes2kib && exit
+ if num_mem_blocks=$(cat /sys/devices/system/memory/memory[0-9]*/state 2>/dev/null | grep -cxF online)
+ then
+ echo $((num_mem_blocks * 0x${mem_block_size})) | bytes2kib
96
+ exit 0
97
+ fi
98
fi
99
if test -r /proc/meminfo
100
0 commit comments