Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
committerSiemKorteweg <Siem.Korteweg@qnh.nl>2015-10-10 14:25:14 +0300
commit0c48fc3880551d862063e56a029ce43082df376a (patch)
treed57f59a582b3d457fccd0dad6f32b3513ebf294f /include/tests_memory_processes
parentc0378f38f517e916b141a8bc5049eb742e66d48f (diff)
Optimized use of cat, grep and awk.
Detection of duplicate entries in /etc/hosts is now more robust. On CentOS7 the SERVICE_MANAGER is detected correctly.
Diffstat (limited to 'include/tests_memory_processes')
-rw-r--r--include/tests_memory_processes2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tests_memory_processes b/include/tests_memory_processes
index b78429db..ef48c4ef 100644
--- a/include/tests_memory_processes
+++ b/include/tests_memory_processes
@@ -29,7 +29,7 @@
if [ -f /proc/meminfo ]; then
logtext "Result: found /proc/meminfo"
Display --indent 2 --text "- Checking /proc/meminfo" --result FOUND --color GREEN
- FIND=`cat /proc/meminfo | grep "^MemTotal" | tr -s ' ' | awk '{ print $2" "$3 }'`
+ FIND=`awk '/^MemTotal/ { print $2, $3 }' /proc/meminfo`
MEMORY_SIZE=`echo ${FIND} | awk '{ print $1 }'`
MEMORY_UNITS=`echo ${FIND} | awk '{ print $2 }'`
logtext "Result: Found ${MEMORY_SIZE} ${MEMORY_UNITS} memory"