Skip to content

Instantly share code, notes, and snippets.

@sandkoan
Created July 5, 2020 17:07
Show Gist options
  • Save sandkoan/5ac2826eabb16f2ebd1b6b84218acd4e to your computer and use it in GitHub Desktop.
Save sandkoan/5ac2826eabb16f2ebd1b6b84218acd4e to your computer and use it in GitHub Desktop.
Display free disk and memory space
#!/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