Menu script | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Menu script

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-16-2003
Ypnos Ypnos is offline
Registered User
 
Join Date: May 2003
Last Activity: 16 February 2005, 9:35 AM EST
Location: Lake District, U.K.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Menu script

It's me again

I would like to create a script that will display a 'Main Menu' which will link to other scripts in the same directory. Is it possible to have a scrolling menu and pretty colours for this?
Sponsored Links
    #2  
Old 06-16-2003
cbkihong cbkihong is offline Forum Advisor  
Advisor
 
Join Date: Sep 2002
Last Activity: 4 May 2014, 6:22 AM EDT
Location: Hong Kong, China
Posts: 1,622
Thanks: 0
Thanked 9 Times in 8 Posts
My humble bare knowledge and incomplete understanding tells me you would like to do some ncurses-like thing. However, I don't think ncurses libraries can be driven by a shell script. Needs some C programming i think.

Otherwise, I think the only way left is to use embed ANSI color sequences but it just adds some color and you can't have effects like the use of arrow keys to jump between and highlight items etc.
Sponsored Links
    #3  
Old 06-16-2003
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
 
Join Date: May 2001
Last Activity: 24 March 2008, 9:43 PM EDT
Location: Chicago IL, USA
Posts: 1,006
Thanks: 0
Thanked 2 Times in 1 Post
if you use ksh you can easily use select or case to build a text menuing system.
    #4  
Old 06-16-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
 
Join Date: Aug 2002
Last Activity: 3 October 2004, 6:07 PM EDT
Location: Cleveland, OH
Posts: 804
Thanks: 0
Thanked 5 Times in 4 Posts
Something like this ksh script (on an 80 col x 25 row screen), where things are carefully positioned.. but this script doesn't include colors, just a menu:
Code:
choice=0

while [ $choice -ne 4 ]
do

clear

echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""
echo "                ###############################################"
echo "                # Choose a script to run from the list below: #"
echo "                #                                             #"
echo "                # 1) Rename script   (./scr)                  #"
echo "                # 2) Another script  (./folder/another)       #"
echo "                # 3) OneMore script  (../progs/onemore)       #"
echo "                #                                             #"
echo "                # 4) QUIT                                     #"
echo "                #                                             #"
echo "                ###############################################"

echo ""
echo -n "                Choice: "
read choice

case "$choice" in
 1 ) ./scr ;;
 2 ) ./folder/another ;;
 3 ) ../progs/onemore ;;
 4 ) clear; exit 1 ;;
esac

done

Sponsored Links
    #5  
Old 06-16-2003
Ypnos Ypnos is offline
Registered User
 
Join Date: May 2003
Last Activity: 16 February 2005, 9:35 AM EST
Location: Lake District, U.K.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
thanks guys, it's a good start
Sponsored Links
    #6  
Old 06-16-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
 
Join Date: Aug 2002
Last Activity: 3 October 2004, 6:07 PM EDT
Location: Cleveland, OH
Posts: 804
Thanks: 0
Thanked 5 Times in 4 Posts
See this tutorial for more information on coloring text using ansi codes: http://www.freeos.com/guides/lsst/mi...olorfunandmore
Sponsored Links
    #7  
Old 06-17-2003
inquirer's Avatar
inquirer inquirer is offline
Registered User
 
Join Date: Aug 2001
Last Activity: 27 May 2014, 2:52 AM EDT
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
follow up question ...

i tried to do search on how to create color text in UNIX and found some. but when i tried to apply them it seems not to be working. i dont know if there is something to do with my terminal settings. if i understand it right my terminal should support colors in order to make one. if so, how can i know my terminal settings and change them? is it permanent or temporary?

thanks,
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Menu in Menu script issue iDdraig Shell Programming and Scripting 1 11-27-2010 06:35 PM
Menu Script looping ultimatix Shell Programming and Scripting 3 08-30-2010 02:31 AM
Menu Script Gboy Shell Programming and Scripting 2 10-31-2008 10:06 AM
Need help with script for menu sinjin Shell Programming and Scripting 0 12-10-2007 02:27 PM



All times are GMT -4. The time now is 10:23 AM.