zl程序教程

您现在的位置是:首页 >  其他

当前栏目

shell脚本编写注意事项

shell 脚本 编写 注意事项
2023-09-27 14:26:13 时间

shell中赋值变量时不能有空格

之前写python写习惯了

test = ‘free -m’

在shell中不能有空格

test='free -m'

而且使用管道符之前要留空格

test='free -m|head -2'是错误的

test='free -m | head -2'