-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviso.sh
More file actions
70 lines (65 loc) · 957 Bytes
/
Copy pathviso.sh
File metadata and controls
70 lines (65 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
function menu {
clear
echo
echo -e "\t\t\tSys Admin Menu\n"
echo -e "\t1.Display disk space"
echo -e "\t2.Display logged on users"
echo -e "\t3.Disply Memory usage"
echo -e "\t0.Exit the Menu\n\n"
echo -en "\t\tEnter your opyion:"
read -n 1 option
}
function disk {
df -h
}
function user {
last
}
function mem {
free -h
}
while true
do
menu
case $option in
1)
clear
disk;;
2)
clear
user;;
3)
clear
mem;;
0)
clear
echo its time say goodby
break;; ####exit退出脚本
*)
clear
echo error;;
esac
echo -en "\t\thit any key to cotinue"
read -n 1 line
done
###############################################
PS3=“请输入你choose” ###特殊提示符
select option in diskmem usronlin memshow quit
do
case $option in
"diskmem")
clear
disk ;;
"useronlin")
clear
user;;
"memshow")
clear
mem;;
"quit")
echo byy
exit;;
esac
done
clear