Skip to content

Commit a625eff

Browse files
fuyaozonglyingbug
authored andcommitted
修复bug:脚本检查系统环境时如果操作系统是Darwin,检查内存使用情况输出为空,原因是正则表达式有问题
1 parent ef69e2a commit a625eff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/start_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ check_environment() {
538538
# 检查内存
539539
log_info "检查内存使用情况..."
540540
if [ "$OS" = "Darwin" ]; then
541-
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages free: (\d+)/ and print "Free Memory: ", $1 * $size / 1048576, " MB\n"'
541+
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages free:\s*(\d+)/ and print "Free Memory: ", $1 * $size / 1048576, " MB\n"'
542542
else
543543
free -h | grep -E "(total|Mem:)"
544544
fi

0 commit comments

Comments
 (0)