PS3="Enter corresponding number and hit enter:"
select DIR in `cat mylist` QUIT
do
if [ -z "$DIR" ]
then
echo "INVALID INPUT"
else
if [ -d "$mysource/$DIR" ]; then
my commands .....
else
break
fi
fi
REPLY=''
done
The above will return something like below :
Select from the list of choices
1) 595
2) 596
3) 597
4) 598
Is there a way i can make it possible to enter multiple choices like 1, 2 . .?
Ah, got you. Sorry for my misunderstanding. I can't give a terminal answer, but to my knowledge that's not possible with select . Unless some other guy can show you a tricky solution, you need to do this kind of selection with echo and read .