Unverified Commit 7c464938 authored by Dylan Araps's avatar Dylan Araps Committed by GitHub

Merge pull request #950 from dylanaraps/rea

general: Remove unsafe splitting.
parents cef3202e 4212e83f
...@@ -1510,7 +1510,8 @@ get_memory() { ...@@ -1510,7 +1510,8 @@ get_memory() {
;; ;;
"AIX") "AIX")
mem_stat=($(svmon -G -O unit=MB)) IFS=$'\n'"| " read -d "" -ra mem_stat <<< "$(svmon -G -O unit=MB)"
mem_total="${mem_stat[11]/.*}" mem_total="${mem_stat[11]/.*}"
mem_free="${mem_stat[16]/.*}" mem_free="${mem_stat[16]/.*}"
mem_used="$((mem_total - mem_free))" mem_used="$((mem_total - mem_free))"
...@@ -1518,7 +1519,9 @@ get_memory() { ...@@ -1518,7 +1519,9 @@ get_memory() {
;; ;;
"IRIX") "IRIX")
mem_stat=($(pmem | head -1)) IFS=$'\n' read -d "" -ra mem_cmd <<< "$(pmem)"
IFS=" " read -ra mem_stat <<< "${mem_cmd[0]}"
mem_total="$((mem_stat[3] / 1024))" mem_total="$((mem_stat[3] / 1024))"
mem_free="$((mem_stat[5] / 1024))" mem_free="$((mem_stat[5] / 1024))"
mem_used="$((mem_total - mem_free))" mem_used="$((mem_total - mem_free))"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment