![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
PFO Founder
![]() ![]() |
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
donemenu.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. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|