reprint the select menu after a selection

Hi,
I am using a select in ksh for a script

#!/bin/ksh
FIRSTLIST='one two three four quit'
PS3='Please select a number: '

select i in $FIRSTLIST  ;
do
  case $i in
       one) print 'this is one' ;;
       two) print 'this is 2' ;;
       three) print 'this is 3' ;;
       four) print 'this is 4' ;;
       quit) break  ;;
       *) print 'Invalid selection please try again' ;;
  esac
done

but after the first selection i want the menu to be showed again, not only the PS3 line.
is it possible? (i need it cause i am using select also for sub menus)
I thought of using a go to, or a pointer , but i wasn't manage to do so in ksh.
and i got to use ksh.
please help...

Hi, try:

...
  esac
  REPLY=
done

thanks,
But it dosent work

Strange, from the ksh93 man page:

What does your man page say?

in the man the reply is not mentioned ,but now i am on redhat and it is working!!!
i tested it first on itanium (hp-ux) there it didnt worked.
any ideas why it works in linux and not in unix?

---------- Post updated 06-15-10 at 03:54 AM ---------- Previous update was 06-14-10 at 11:37 AM ----------

just checked it again.
Linux - worked
HP-UX - didn't work
Any suggestions please?

Two suggestions:

  1. What happens if you use:
REPLY=""
  1. what happens if you use /usr/dt/bin/dtksh instead of ksh

You can try this we let the results

#!/bin/ksh
for i in '1)one 2)two 3)three 4)four 5)quit' ; do
   while [ "$i" != "5" ];   do
echo "1) one
2) two
3) three
4) four
5) quit"
print "Please select a number: \c"
read selct
 
case $selct in
       1) print 'this is one' ;;
       2) print 'this is 2' ;;
       3) print 'this is 3' ;;
       4) print 'this is 4' ;;
       5) break  ;;
       *) print 'Invalid selection please try again' ;;
esac
done
        done

no change under HP-UX.:mad:

ygemici -> I prefer to use select only cause of that i am making alot of cahnges in the menues and sub menus, it is a lot to change with out select only