We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当我运行os-check 巡检后,生成的html文件报错 如图所示
具体报错: check_linux.sh: line 41: -: -: syntax error: operand expected (error token is "-") check_linux.sh: line 43: -: -: syntax error: operand expected (error token is "-")
操作系统 CentOS Linux release 7.9.2009 (Core)
The text was updated successfully, but these errors were encountered:
我查看了一下,发现是在检测inode时,被传入了一个非数值参数 “-”,导致-ge对比时由于不为数值报错的,可能需要在进行ge对比时校验下是否为数字
Sorry, something went wrong.
感谢提醒,我加了个数字判断。你可以试试。
Ansible-roles/os-check/files/check_linux.sh
Line 41 in c1ef43c
加了判断没有生效,我加了个判断,你可以参考下
# value=${2:-0} if [[ $2 =~ '\^[1-9]+\$' ]]; then value=${2} else value=0 fi
if [[ $2 =~ '^[1-9]+$' ]]; then value=${2} else value=0 fi
试了下 这个 可以解决那个问题
后面又重新看了下,这个还要考虑下有小数的情况,我这里又改了一版,你们试试。
Lines 41 to 42 in 24a53f6
No branches or pull requests
当我运行os-check 巡检后,生成的html文件报错
如图所示
具体报错:
check_linux.sh: line 41: -: -: syntax error: operand expected (error token is "-")
check_linux.sh: line 43: -: -: syntax error: operand expected (error token is "-")
操作系统
CentOS Linux release 7.9.2009 (Core)
The text was updated successfully, but these errors were encountered: