I'm using kshon an HP-UX box.
In a portion of my script, I want to list certain files (*.xml), have them numbered and have the user choose a file by typing the number and hitting enter. That filename will then be stored as a variable.
Example of output:
Please choose a file:
1) bar27.xml
2) foo1.xml
3) foobar4.xml
Then the user types in 1, 2, or 3 and hit enter. The file name chosen needs to be stored as a variable. So if the user chooses 2 the variable should contain foo1.xml.
selectbuilt-in. It's designed to support that. Note that a web-based search may be trickier;selecthas lots of meanings. Searching with 'ksh select' gets on -topic results for me, including Linux scriptselectmenu.selectand leave a comment that you have updated your Q. If you get it working either post your Answer (you can accept your own answer after 48 hrs to gain valuable reputation points) or delete this Q. Good luck.