1748142 Members
3731 Online
108758 Solutions
New Discussion юеВ

Menu programming

 
SOLVED
Go to solution
Oviwan
Honored Contributor

Menu programming

Hi @ll,

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
1)
echo "foo bar"
break
;;
2)
echo "foo bar 1"
break
;;
esac
done

but exist something who looks more professional than that?

Thanks & Regards



16 REPLIES 16
Luk Vandenbussche
Honored Contributor

Re: Menu programming

Hi,

If you add a new in SAM, it is shell script based.
Oviwan
Honored Contributor

Re: Menu programming

Exist somewhere an example script that i can adapt to my rules?
Laurent Menase
Honored Contributor

Re: Menu programming

Hi Try /usr/dt/bin/dtksh
examples are in /usr/dt/examples/dtksh
Laurent Menase
Honored Contributor

Re: Menu programming

Or do you mean a curses oriented menu?
Laurent Menase
Honored Contributor

Re: Menu programming

For Sam I believe, it is mainly in C, only a few parts are scripts.
it uses a undocumented library called libObam which does curses or X11 depending if DISPLAY is defined. In any case it is not usable
Geoff Wild
Honored Contributor

Re: Menu programming

Here's a text based one I use - shell based - this one is called lp.mnu:

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Oviwan
Honored Contributor

Re: Menu programming

Thanks @ll

@Geoff: that's what I searched

the dtksh is also nice, but i need a textbased menu. I found this thread for dtksh:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=101310

has someone an idea whether exists also something in perl?

Regards
Muthukumar_5
Honored Contributor

Re: Menu programming

default perl is not having switch case statement as like shell prompt. If you want text based on terminal then you can go with case;do done statements itself.

-Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Menu programming

You can use Perl with add-on modules to program menu driven apps. Check www.cpan.org for more information

http://search.cpan.org/~corliss/CursesWidgets-1.997/Widgets/Menu.pm

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