File Select Menu Script

Hi All,

I need to develop a bash script list �list of files� and able to select if any and set as globe variable in script and use for other function.

I would like to see in menu format.

Example out put

Below are the listed files for database clone

1. Sys.txt
2. abc.txt
3. Ddd.txt
4. Eee.txt

Select the file to be clone
1. sys.txt

Thanks in advance.

You could use select for this. Something to start you off:

PS3='Your Choice? '
select file in Sys.txt abc.txt Ddd.txt Eee.txt
do
 case $REPLY in
    1|2|3|4) echo "That was $file you entered";break;;
    *) echo "What the heck did you enter?"
 esac
done