1、编写hello world脚本
#!/bin/bash
echo “Hello World!”
2、通过位置变量创建 Linux 系统账户及密码
#!/bin/bash
useradd “$1”
echo “$2” | passwd ‐‐stdin "KaTeX parse error: Expected 'EOF', got '#' at position 15: 1" **3、备份日志** #̲!/bin/bash #vim…(df / | awk '///{print KaTeX parse error: Expected 'EOF', got '}' at position 2: 4}̲') mem_size=(free | awk ‘/Mem/{print $4}’)
while :
do
if [ $disk_size -le 512000 -a $mem_size -le 1024000 ]
then
mail ‐s “Warning” root <<EOF
Insufficient resources
EOF
fi
done
shell编程100例:1-5例
最新推荐文章于 2024-06-04 10:21:33 发布