Created
July 5, 2020 17:07
-
-
Save sandkoan/5ac2826eabb16f2ebd1b6b84218acd4e to your computer and use it in GitHub Desktop.
Display free disk and memory space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
press_enter() | |
{ | |
echo -en "\nPress Enter to continue" | |
read | |
clear | |
} | |
selection= | |
until [ "$selection" = "0" ]; do | |
echo " | |
PROGRAM MENU | |
1 - display free disk space | |
2 - display free memory | |
0 - exit program | |
" | |
echo -n "Enter selection: " | |
read selection | |
echo "" | |
case $selection in | |
1 ) df -h ; press_enter ;; | |
2 ) free -h ; press_enter ;; | |
0 ) exit ;; | |
* ) echo "Please enter 1, 2, or 0"; press_enter | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment