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:
The key point above is that the menu is populated by the result set from a database query, with only one column being selected, so that each row in the resultset is one menu entry.
Now I have a new challenge. I need to select multiple columns, but I still need each complete row to be one menu entry. So that if my SELECT statement becomes
And the result set is
The menu should be
The problem is that by default, the 'select' breaks on spaces, and I have spaces between columns of the result, and even within the data of some columns.
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)
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)
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)
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)
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)
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)
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)
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)
Oracle Linux 5.6 64-bit
Given the below snippet
ORACLE_SID=''
PS3='Select target (test) database being refreshed: '
#
while ]; do
select ORACLE_SID in `egrep -i '^FS|^HR' /etc/oratab |\
awk -F\: '{print $1}'|sort` ; do
if ]; then
echo
echo "Please enter a... (19 Replies)
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
LEARN ABOUT DEBIAN
io::async::loop::select
IO::Async::Loop::Select(3pm) User Contributed Perl Documentation IO::Async::Loop::Select(3pm)NAME
"IO::Async::Loop::Select" - use "IO::Async" with "select(2)"
SYNOPSIS
Normally an instance of this class would not be directly constructed by a program. It may however, be useful for runinng IO::Async with an
existing program already using a "select" call.
use IO::Async::Loop::Select;
my $loop = IO::Async::Loop::Select->new;
$loop->add( ... );
while(1) {
my ( $rvec, $wvec, $evec ) = ('') x 3;
my $timeout;
$loop->pre_select( $rvec, $wvec, $evec, $timeout );
...
my $ret = select( $rvec, $wvec, $evec, $timeout );
...
$loop->post_select( $rvec, $evec, $wvec );
}
DESCRIPTION
This subclass of "IO::Async::Loop" uses the select(2) syscall to perform read-ready and write-ready tests.
To integrate with an existing "select"-based event loop, a pair of methods "pre_select" and "post_select" can be called immediately before
and after a "select" call. The relevant bits in the read-ready, write-ready and exceptional-state bitvectors are set by the "pre_select"
method, and tested by the "post_select" method to pick which event callbacks to invoke.
CONSTRUCTOR
$loop = IO::Async::Loop::Select->new
This function returns a new instance of a "IO::Async::Loop::Select" object. It takes no special arguments.
METHODS
$loop->pre_select( $readvec, $writevec, $exceptvec, $timeout )
This method prepares the bitvectors for a "select" call, setting the bits that the Loop is interested in. It will also adjust the $timeout
value if appropriate, reducing it if the next event timeout the Loop requires is sooner than the current value.
$readvec
$writevec
$exceptvec
Scalar references to the reading, writing and exception bitvectors
$timeout
Scalar reference to the timeout value
$loop->post_select( $readvec, $writevec, $exceptvec )
This method checks the returned bitvectors from a "select" call, and calls any of the callbacks that are appropriate.
$readvec
$writevec
$exceptvec
Scalars containing the read-ready, write-ready and exception bitvectors
$count = $loop->loop_once( $timeout )
This method calls the "pre_select" method to prepare the bitvectors for a "select" syscall, performs it, then calls "post_select" to
process the result. It returns the total number of callbacks invoked by the "post_select" method, or "undef" if the underlying select(2)
syscall returned an error.
SEE ALSO
o IO::Select - OO interface to select system call
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::Loop::Select(3pm)