Time to give our client a menu

In this chapter, we are looking at different ways to play with loops in order to work on the pieces of information the user provides us with. From a simple menu, we moved onto something fancier and better looking; and now, it is time to take a step further and have a look at the select construct whose task is to let us create menu in an effortless way. Its syntax is similar to the for construct:

select placeholder [in list]docommand_1command_2command_ndone

So, as we can see, this construct is very similar to for and sports a list, which gets expanded on the standard error in a series of elements preceded by a number. If we omit the in list part, the list gets constructed from the positional parameters given ...

Get Mastering Bash now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.