一、通过查看主机性能编写循环菜单执显示响应结果
1.w
2. ps -aux | head -3
3.top |head -3
4.free
5.quit
[root@localhost day6]# vim caidan.sh
#!/bin/bash
read -p "请输入系统名称:" name
select n in `seq 1 5`;do
case $n in
1)
w
;;
2)
ps -aux | head -3
;;
3)
top |head -3
;;
4)
free
;;
5)
echo quit
;;
*)
echo "重新输入选项"
break
esac
done
二、打印九九乘法表
-
使用echo打印结果
vim jjc.sh
#!/bin/bash
for((i=1;i<10;i++));do
for((j=1;j<=i;j&#