-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu_script.sh
More file actions
31 lines (29 loc) · 813 Bytes
/
menu_script.sh
File metadata and controls
31 lines (29 loc) · 813 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
#!/bin/bash
while true; do
echo "Please select an option (1-4):"
select option in "Display the current date and time" "List files in the current directory" "Display the current user" "Exit the script"; do
case $REPLY in
1)
echo "Current date and time: $(date)"
break
;;
2)
echo "Files in the current directory:"
ls -l
break
;;
3)
echo "Current user: $(whoami)"
break
;;
4)
echo "Goodbye!"
exit 0
;;
*)
echo "Invalid option. Please try again."
break
;;
esac
done
done