安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

freeMemorysh line 16 integer expression expected sh脚本报错#!binsh#内存总量total=$ free -m grep Mem awk print $2#已使用内存used=$ free -m grep Mem awk print $3#空闲内存free=$ free -m grep Mem awk print $4#内存使用

  • 日期: 2025-01-02
  • 标签: 综合

在第16行的if语句中,$1没有被定义或传入值,导致无法进行比较,需要检查调用该脚本时是否传入了参数。另外,第12行的time=date应该改为time=$(date)。

freeMemorysh line 16 integer expression expected sh脚本报错#!binsh#内存总量total=$ free -m grep Mem awk print $2#已使用内存used=$ free -m grep Mem awk print $3#空闲内存free=$ free -m grep Mem awk print $4#内存使用

原文地址: https://www.cveoy.top/t/topic/fcKG 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: 舉出在日程生活中所經歷的一件事「讓您有特別的體會或領悟的事」試論述說出「這件事足以構成個人內心所呈現的美」請寫600~700字文章
  • 下一篇: 如何加强企业培训以增加员工和管理层的应收账款风险识别意识

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2