Skip to content

Instantly share code, notes, and snippets.

@adionditsak
Created February 23, 2015 08:19
Show Gist options
  • Save adionditsak/cc57ebb27cd17e3ea11d to your computer and use it in GitHub Desktop.
Save adionditsak/cc57ebb27cd17e3ea11d to your computer and use it in GitHub Desktop.

Revisions

  1. adionditsak created this gist Feb 23, 2015.
    29 changes: 29 additions & 0 deletions tput_menu.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    #!/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