-
Notifications
You must be signed in to change notification settings - Fork 2
/
basic_menu.sh
63 lines (57 loc) · 1.03 KB
/
basic_menu.sh
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
#!/bin/bash
# Basic shell program that displays a menu of commands
# Author: jcalvarezj
# Created at: 18/12/2021
# Version: 1.0.0
echo " --------------------------"
echo "| |"
echo "| H E L L O W O R L D |"
echo "| |"
echo " --------------------------"
option=-1
while [[ $option -ne 7 ]]; do
echo "What do you wanna do?"
echo "1. Check current processes"
echo "2. Available RAM memory"
echo "3. Available disk space"
echo "4. Network information (requires net-tools)"
echo "5. List all environment variables (LESS)"
echo "6. List all installed packages"
echo "7. Finish"
read -n1 -p "Please choose an option: " option
echo
echo
if [[ "$option" =~ '^[0-9]$' ]]; then
echo "NUMBERS ONLY, DUDE!"
else
case $option in
1)
top
;;
2)
free
echo
;;
3)
df -H
echo
;;
4)
ifconfig
echo
;;
5)
printenv | less
;;
6)
dpkg -l
;;
7)
echo "Bye-bye"
;;
*)
echo "Not a valid option"
;;
esac
fi
done