Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 23rd, 2004, 11:57 AM   #1
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,667
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
here is my menu script i wrote awhile back. i know its pretty boring but im bored and thought i should post something in here finally

menu
#bin/sh
cd
clear
menu.awk
while :
do
    read INPUT_STRING
    case $INPUT_STRING in
    1)
        echo "Enter the name or ip of computer you want to connect to."
        read ssh_string
        echo "Enter your user name for this machine."
        read user_string
        ssh -l $user_string $ssh_string
        clear
        menu.awk
        ;;
    2)
        clear
        mc
        clear
        menu.awk
        ;;

    3)
        clear
        echo "Option 3 is Unused"; echo
        menu.awk
        ;;
    4)
        echo "Enter File to change permissions of."
        read file_perm
        echo "Enter permissions you want to use, using the number system."
        read perm
        chmod $perm $file_perm
        clear
        echo "File permissions have been changed."; echo
        menu.awk
        ;;
    5)
        echo "Enter Directory to change permisions of."
        read dir_perm
        echo "Enter permissions you want to use, using the number system."
        read perm2
        chmod -R $perm2 $dir_perm
        clear
        echo "Directory permissions have been changed."; echo
        menu.awk
        ;;
    6)
        clear
        ls -la | less
        echo
        menu.awk
        ;;
    7)
        echo "Enter the Directory you want to move to."
        read dir
        cd $dir
        clear
        menu.awk
        ;;
    8)
        clear
        echo "Enter File you want to edit"
        read file
        vim $file
        clear
        menu.awk
        ;;
    9)
        clear
        echo "Option 9 is Unused"; echo
        menu.awk
        ;;
    10)
        clear
        echo "Option 10 is Unused"; echo
        menu.awk
        ;;
    clear)
        clear
        menu.awk
        ;;
    //)
        echo "Exiting!"
        break
        ;;
    *)
        echo "Sorry, I don't understand"
        ;;
esac
done

menu.awk
awk 'BEGIN { menu="************** MENU ****************\n"
    menu=menu "* 1) SSH To Remote Computer    *\n"
    menu=menu "* 2) Midnight Commander      *\n"
    menu=menu "*   (Command line file manager) *\n"
    menu=menu "* 3)                *\n"
    menu=menu "* 4) Change File Permissions   *\n"
    menu=menu "* 5) Change Dir Permissions    *\n"
    menu=menu "* 6) List Files in Directory   *\n"
    menu=menu "* 7) Change Directory       *\n"
    menu=menu "* 8) Edit File in Direcotry    *\n"
    menu=menu "* 9)                *\n"
    menu=menu "* 10)               *\n"
    menu=menu "*                 *\n"
    menu=menu "* clear) Clear Screen       *\n"
    menu=menu "* //) Quit to Prompt        *\n"
    menu=menu "************************************\n"
    menu=menu "\n"
    menu=menu "Enter Your Selection: "
    print menu }'

if you put both of these files in your /usr/bin/ dir you can just run the thing by typing menu anywhere you are
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:09 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC