Sponsored Content
Top Forums Shell Programming and Scripting Format of 'select' generated menu Post 302899679 by Corona688 on Wednesday 30th of April 2014 03:51:03 PM
Old 04-30-2014
Quote:
Originally Posted by sea
Is it meaningful to set COLUMNS hardcoded to any and every terminal(-window) just so select looks 'pretty'?
That's a rather loaded question. I don't even know which layout you consider "prettiest" yet.

No, you should not hardcode COLUMNS to make select prettier. Doing this may cause inconsistent, unreliable, or unreadable results across different systems, terminals, and shells.

If the end user wants to hardcode their COLUMNS that's another matter. They'd be the one to know how big their terminal is.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

dynamic Select menu

Hi all is menu driven by SELECT can be a dynamic ? My requirement is that i want SELECT to be created on run time not predefine . The select should be created as per the no of words in a file thanks in advance rawat (2 Replies)
Discussion started by: rawatds
2 Replies

2. Shell Programming and Scripting

Drop down menu in bash for timezone select

Is there any way to implement a drop down menu selection in bash? This is on CDLinux which is a very minimal live CD and I am using it to install an image onto a hard drive. Part of that process is the timezone selection. There are just too many timezones to attempt to use the "select" command.... (1 Reply)
Discussion started by: simonb
1 Replies

3. Shell Programming and Scripting

reappearing menu list using select

is there a way I can make the menu list reappear when I use select ? ----- menulist="Change_title Remove_tag Change_tag Add_line Quit" select word in $menulist #change_title remove_tag change_tag add_line quit do case $word in # first menu option Change Title ... (9 Replies)
Discussion started by: forever_49ers
9 Replies

4. Shell Programming and Scripting

Select command to build menu

Hello everyone. I am using the select command to build a menu, here is my question: Is it possible to generate a menu which contains several sections and have a separator between the sections without having a selection number generated in front of the separator? This is a sample of what I would... (1 Reply)
Discussion started by: gio001
1 Replies

5. Shell Programming and Scripting

Error using select menu command

Hi All, I am trying to use the select command & the menu. below mention is my script #!/bin/bash 2 3 PS3="Is today your birthday? " #PS3 system variable 4 5 echo "\n" 6 7 8 select menu_selection in YES NO QUIT 9 do 10 11 ... (1 Reply)
Discussion started by: milindb
1 Replies

6. Shell Programming and Scripting

reprint the select menu after a selection

Hi, I am using a select in ksh for a script #!/bin/ksh FIRSTLIST='one two three four quit' PS3='Please select a number: ' select i in $FIRSTLIST ; do case $i in one) print 'this is one' ;; two) print 'this is 2' ;; three) print 'this is 3' ;; four) print... (7 Replies)
Discussion started by: omerzzz
7 Replies

7. Shell Programming and Scripting

Select ksh menu question

I am creating a Select menu with a few options and I would like to create a "better" looking interface than just this: 1) Option 1 2) Option 2 3) Option 3 Instead, I would like something like this: *********** * Cool Script * * 1) Option 1 * * 2) Option 2 * * 3) Option 3 *... (2 Replies)
Discussion started by: chipblah84
2 Replies

8. Shell Programming and Scripting

File Select Menu Script

Hi All, I need to develop a bash script list “list of files” and able to select if any and set as globe variable in script and use for other function. I would like to see in menu format. Example out put Below are the listed files for database clone 1. Sys.txt 2. abc.txt 3. Ddd.txt... (1 Reply)
Discussion started by: ashanabey
1 Replies

9. Shell Programming and Scripting

Help with 'select' for menu input

A lot of my scripting makes use of the 'select' command to create menu driven input. A typical example of how I use it is as: somevar='' PS3='Select one: ' while ]; do select somevar in $(sqlplus -s $dbuser/$dbpw@mydb <<EOF set echo off feedback off verify off... (7 Replies)
Discussion started by: edstevens
7 Replies

10. Shell Programming and Scripting

Stuck with menu in select

hi i am new to bash scripting .. i created a bunch of folders but only want the folder names with file1. so i go in and make an array to grab the folders the put in a file then i strip the directories so i just have the folder names i need then i would like to make the menu with a selection... (3 Replies)
Discussion started by: lamby22
3 Replies
del_curterm(3XCURSES)					  X/Open Curses Library Functions				     del_curterm(3XCURSES)

NAME
del_curterm, restartterm, set_curterm, setupterm - interfaces to the terminfo database SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <term.h> int del_curterm(TERMINAL *oterm); int restartterm(char *term, int fildes, int *errret); TERMINAL *set_curterm(TERMINAL *nterm); int setupterm(char *term, int fildes, int *errret); DESCRIPTION
Within X/Open Curses, the setupterm() function is automatically called by the initscr(3XC) and newterm(3XC) functions. This function can be also be used outside of X/Open Curses when a program has to deal directly with the terminfo database to handle certain terminal capa- bilities. The use of appropriate X/Open Curses functions is recommended in all other situations. The setupterm() function loads terminal-dependent variables for the terminfo layer of X/Open Curses. The setupterm() function initializes the terminfo variables lines and columns such that if use_env(FALSE) has been called, the terminfo values assigned in the database are used regardless of the environmental variables LINES and COLUMNS or the program's window dimensions; when use_env(TRUE) has been called, which is the default, the environment variables LINES and COLUMNS are used, if they exist. If the environment variables do not exist and the program is running in a window, the current window size is used. The term parameter of setupterm() specifies the terminal; if null, terminal type is taken from the TERM environment variable. All output is sent to fildes which is initialized for output. If errret is not null, OK or ERR is returned and a status value is stored in the integer pointed to by errret. The following status values may be returned: +-----------------------------------------------------------+ | Value Description | |1 Normal | |0 Terminal could not be found | |-1 terminfo database could not | | be found | +-----------------------------------------------------------+ If errret is null, an error message is printed, and the setupterm() function calls the exit() function with a non-zero parameter. The set_curterm() function sets the cur_term variable to nterm. The values from nterm as well as other state information for the terminal are used by X/Open Curses functions such as beep(3XCURSES), flash(3XCURSES), mvcur(3XCURSES), tigetflag(3XCURSES), tigetstr(3XCURSES), and tigetnum(3XCURSES). The del_curterm() function frees the space pointed to by oterm. If oterm and the cur_term variable are the same, all Boolean, numeric, or string terminfo variables will refer to invalid memory locations until you call setupterm() and specify a new terminal type. The restartterm() function assumes that a call to setupterm() has already been made (probably from initscr() or newterm()). It allows you to specify a new terminal type in term and updates the data returned by baudrate(3XCURSES) based on fildes. Other information created by the initscr(), newterm(), and setupterm() functions is preserved. PARAMETERS
oterm Is the terminal type for which to free space. term Is the terminal type for which variables are set. fildes Is a file descriptor initialized for output. errret Is a pointer to an integer in which the status value is stored. nterm Is the new terminal to become the current terminal. RETURN VALUES
On success, the set_curterm() function returns the previous value of cur_term. Otherwise, it returns a null pointer. On success, the other functions return OK. Otherwise, they return ERR. ERRORS
None. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
baudrate(3XCURSES), beep(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), mvcur(3XCURSES), tigetflag(3XCURSES), use_env(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 del_curterm(3XCURSES)
All times are GMT -4. The time now is 04:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy