1748255 Members
3953 Online
108760 Solutions
New Discussion юеВ

Re: Menu programming

 
SOLVED
Go to solution
Arturo Galbiati
Esteemed Contributor

Re: Menu programming

Hi,
if you are interested I use a menu driveen created by awk. It's a general purpuose: you write in a file the line you want to see in teh menu and the associated command and nothing else.
Let me know if you want it and I'll attach.
(I'd like to avoid to attach unuseful scripts)

HTH,
Art
Laurent Menase
Honored Contributor
Solution

Re: Menu programming

An example of what we can do in ksh
Oviwan
Honored Contributor

Re: Menu programming

Thanks again @ll

@Art: it would be nice if you could attache the awk script, thx

Arunvijai_4
Honored Contributor

Re: Menu programming

Here is an example using AWK,

http://www.iiug.org/software/archive/dbamenu
http://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arturo Galbiati
Esteemed Contributor

Re: Menu programming

In the zip file there are the script and and example of the use.
The script to run is Menu.ksh.
HTH,
Art
Laurent Menase
Honored Contributor

Re: Menu programming

Hi All,

Just a remark,

if you press space it toggles the line.
If you want to suppress that feature just comment the " ") case in the switch.
I saw too that the "tput cnorm" is not the right value to clear the bold mode, It is better to use "tput sgr0" to clear all the atributes at its place.

Also, the trick used it to set the non canonical mode with a timeout of (200ms) time=2 and min=1 (at least a charactere).
Sometimes it doesn't work as expected, so raise min to 3.
stty -icanon -echo min 3 time 2 ;
This will wait for 3 characteres or a inter timeout of 200ms
Rodney Hills
Honored Contributor

Re: Menu programming

You could check out the "keysh" shell. It is somewhat programmable. Though it doesn't present a menu, it does use function keys to select tasks. Do a "man keysh" for more info.

Rod Hills
There be dragons...