diff --git a/quickemu b/quickemu index 8514ad065c..d3806f30a6 100755 --- a/quickemu +++ b/quickemu @@ -562,7 +562,7 @@ function configure_ram() { RAM_HOST=$(($(sysctl -n hw.memsize) / (1048576*1024))) else # Determine the number of gigabytes of RAM in the host by extracting the first numerical value from the output. - RAM_HOST=$(free --giga -h | tr ' ' '\n' | grep -m 1 [0-9] | cut -d'G' -f 1) + RAM_HOST=$(free --giga -h | tr ' ' '\n' | grep -m 1 "[0-9]" | cut -d'G' -f 1) fi if [ "${RAM_HOST}" -ge 128 ]; then diff --git a/quickreport b/quickreport index b690fb17b9..8dbe479528 100755 --- a/quickreport +++ b/quickreport @@ -41,7 +41,7 @@ quick_report() { echo -e "Memory:\t$(($(sysctl -n hw.memsize) / (1048576*1024)))G" else # Determine the number of gigabytes of RAM in the host by extracting the first numerical value from the output. - echo -e "Memory:\t$(free --giga -h | tr ' ' '\n' | grep -m 1 [0-9] | cut -d'G' -f 1)G" + echo -e "Memory:\t$(free --giga -h | tr ' ' '\n' | grep -m 1 "[0-9]" | cut -d'G' -f 1)G" fi # Break IFS on new line