|
Bash Select Function: Formatting Output
#!/bin/bash
clear
OPTIONS="option1 option2 option3 option4 option5 option6"
select opt in $OPTIONS; do
When writing menus for the CLI I start off with the above then use if statements to set up the menus. It works great but I would like to format the output displayed on the screen. As it is the menu script will display:
1) option 1 3) option3 5) option5
2) option 2 4) option4 6) option6
I would like to have the output look more like this for small menus:
1) option 1
2) option 2
3) option3
4) option4
5) option5
6) option6
I am sure the solution is simple but I can't seem to find the answer.
How would you format the output as wanted?
Thanks,
Ted.
|