Skip to content

Commit

Permalink
fix: running quickemu and quickreport in zsh. close #1268
Browse files Browse the repository at this point in the history
Due to zsh auto completion of piping to `grep [0-9]` does not work. This patch fixes this problem by quoting `"[0-9]"`.
  • Loading branch information
flexiondotorg committed Jun 24, 2024
1 parent 9b1c28d commit 9303b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion quickreport
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9303b73

Please sign in to comment.