On Fri, 2003-11-14 at 10:46, Kwan Lowe wrote:
> > Fajar Priyanto wrote:
> > Dear All,
> > Can we make menu in bash script just like in DOS' batch file?
> > Such as:
> > =======
> > [Menu]
> > Pls select what you want to do:
> > 1. Copy /etc/dhcpd.conf
> > 2. Copy /etc/wvdial.conf
> > 3. Make directory /var/log/nullmailer
> > 4. Do all of above
> > ======
> > Could you please give me some examples?
> 
> Besides the case operator that someone else has mentioned, you can also
> use the "dialog" utility to create menu boxes. For example:
> 
> 
> dialog --clear --backtitle "A Checkbox" --title "Choose one:" \
> --menu "Please select one item:\n" 30 30 8 \
>  "Item1" "Choose me" \
>  "Item2" "No, choose me" \
>  "Item3" "Better choose me"
> 
> The selection will be sent to stderr which you can either capture to a
> file or read directly. You'll still need the case operator or nested ifs
> to act on the user choice. Dialog will also do text input, checkbox,
> radiobox, etc..
> 
> If dialog is cumbersome but you do like the interactivity, take a look at
> the "newt" package. It has some very easy ways of generating similar
> menus.

but if you learn dialog, then you can readily port the same script to
xdialog, which is keen :-)

-- Jack Coates at Monkeynoodle Dot Org: It's A Scientific Venture...
"Come on you rambling boys of pleasure and ladies of easy leisure, we
must say A dios until we see Almaria once again." -- Fiesta from If I
Should Fall From Grace With God by The Pogues


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to