|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
if you use ksh you can easily use select or case to build a text menuing system.
|
|
#4
|
||||
|
||||
|
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
|
|||
|
|||
|
thanks guys, it's a good start
![]() |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
See this tutorial for more information on coloring text using ansi codes: http://www.freeos.com/guides/lsst/mi...olorfunandmore
|
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
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 | ||
|
![]() |
| Thread Tools | Search this Thread |
| 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 |
|
|