#!/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...
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?
#!/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
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