Re: [Bashburn-info] Pressing any key in menu balks
Brought to you by:
bashburn
|
From: Nick W. <ni...@uk...> - 2008-08-30 16:48:07
|
On Sat, 30 Aug 2008 17:45:31 +0100
Nick Warne <ni...@uk...> wrote:
> On Sat, 30 Aug 2008 12:03:10 -0400 (EDT)
> "Steven W. Orr" <st...@sy...> wrote:
>
> > I pulled a rabbit outa ma hat. I hope we didn't step on each other.
>
> NP.
>
> > if (( selection == 0 )) && [[ "$chselection" != 0 ]]
> > then
> > echo 'Error: Input must be numeric'
> > elif (( selection >= 0 && selection < size ))
> > then
> > eval ${action[selection]} # Do it baby.
> > else
> > # Bitch if the input was out of bounds.
> > echo 'Error: Input must be in range'
> > nogood=1
> > fi
>
> Very good. Many ways to skin a cat in GNU/Linux world.
>
> Works great.
>
> Nick
Famous last words. If you type a none digit/alpha character (i.e. # ~
@ etc. ) oops.
The regex line I done just stripped anything that wasn't a digit.
Nick
--
Free Software Foundation Associate Member 5508
|