Skip to content

Instantly share code, notes, and snippets.

@adionditsak
Created February 23, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adionditsak/cc57ebb27cd17e3ea11d to your computer and use it in GitHub Desktop.
Save adionditsak/cc57ebb27cd17e3ea11d to your computer and use it in GitHub Desktop.
tput cli menu dummy with 4 options
#!/bin/bash
tput clear
main_menu()
{
until [ option = 4 ]; do
tput setb 2
tput setf 5
read -p """
1.) Monitor existing processes
2.) Copy /etc/passwd to /home directory
3.) Ping local host
4.) Exit
Enter choice: """ option
echo
case $option in
1) ps aux;echo "The list has been successfully generated!";;
2) cp /etc/passwd /home;echo "The passwd file has been copied to your home directory.";;
3) ping -c 4 127.0.0.1;echo "You have completed pinging localhost" ;;
4) exit;;
*) tput setf 4; echo "Please enter between number 1 and 4\n\n";;
esac
done
}
main_menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment