Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-27-2004, 03:22 PM   #1
Registered: May 2003
Posts: 598

Rep: Reputation: 30
Bash Select Function: Formatting Output

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?

Old 03-27-2004, 04:12 PM   #2
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
Im not absolutely sure but try \n after each option and see if that helps.
Old 03-28-2004, 06:26 AM   #3
Registered: May 2003
Posts: 598

Original Poster
Rep: Reputation: 30
Nope, it just sees the \n as another option to display on the screen. If I put \n after the OPTION line it just says it can't find the directory.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: html Form Select function problem camlinux Programming 2 05-15-2005 08:23 PM
Formatting output of ls doodar Linux - Newbie 29 07-29-2004 01:25 PM
select function as timeout? frostmagic Programming 2 02-09-2004 11:56 AM
need hlp formatting output from ls test* Evan P. Programming 1 11-06-2003 08:40 PM
bash: can't get out of SELECT adam_boz Programming 2 09-16-2002 11:53 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration