I'm developing a deployment script at work and at one point it would need to display something like this:
Which version of ADMIN would you like to deploy?
1) 1.0.0 (store1, 10 Jan 2004)
2) 1.0.1 (store1, 20 Jun 2004)
3) 1.0.2 (store1, 15 Jul 2004)
Select a version :
I know how I could do this in the hardcoded way, BUT the list of menu items being displayed is collected dynamically when needed.
The actual question being : Is it possible to somehow parameterise the select statement so that it displays menu items in which blanks can appear.
Example of hardcoded way :
select option in "one one" "two two"; do
break
done
displays:
1) one one
2) two two
So, how can this "one one" "two two" part in the select be replaced by something that is parameterised.
Now image that the actual data is completely unknown and dynamically created. The result in my case is put in file. This would mean a flat text file with something like this :
one one
two two
in it.
The contents of the file can be modified to make it work, but I don't seem to succeed.