12-19-2005 01:30 AM
what is the best way to programm a menu like the SAM. in which language is SAM programmed?
I prefer Perl or KSH. exists in Perl a module for a menu.
I saw in KSH exist something like:
select what in "Point1" "Point2"; do
case $REPLY in
echo "foo bar"
echo "foo bar 1"
but exist something who looks more professional than that?
Thanks & Regards
Solved! Go to Solution.
12-19-2005 03:30 AM
it uses a undocumented library called libObam which does curses or X11 depending if DISPLAY is defined. In any case it is not usable
12-19-2005 03:54 AM
12-19-2005 07:04 PM
@Geoff: that's what I searched
the dtksh is also nice, but i need a textbased menu. I found this thread for dtksh:
has someone an idea whether exists also something in perl?
12-19-2005 07:15 PM
12-19-2005 07:24 PM
12-19-2005 07:57 PM
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)
12-19-2005 11:01 PM
12-21-2005 10:32 PM
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
12-22-2005 02:19 AM