Skip to content

Commit

Permalink
Merge branch 'shell' of github.com:gov360/shell into shell
Browse files Browse the repository at this point in the history
  • Loading branch information
gov360 committed Nov 21, 2019
2 parents 8b8879b + bfa8885 commit be3b487
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions case.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# case-menu: a menu driven system information program
clear
echo "
Please Select:
1. Display System Information
2. Display Disk Space
3. Display Home Space Utilization
0. Quit
"
read -p "Enter selection [0-3] > "
case $REPLY in
0) echo "Program terminated."
exit
;;
1) echo "Hostname: $HOSTNAME"
uptime
;;
2) df -h
;;
3) if [[ $(id -u) -eq 0 ]]; then
echo "Home Space Utilization (All Users)"
du -sh /home/*
else
echo "Home Space Utilization ($USER)"
du -sh $HOME
fi
;;
*) echo "Invalid entry" >&2
exit 1
;;
esac

0 comments on commit be3b487

Please sign in to comment.