Select command array


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Select command array
# 1  
Old 08-04-2008
Select command array

Hello everyone,
I have a quick question about the select command in ksh. I am using it to define a menu for user selection, I have found that the REPLY var contains the input from the user, I was interested to find out if there is a system variable that contains the whole menu as an array, the reason being that I would like the user to be allowed multiple selections from the menu, at that point all of those would be in $REPLY as a sequence of numbers, still I would like to resolve those numbers to what selection they all were in the menu.
I hope you can help.
Thanks.
# 2  
Old 08-04-2008
Quote:
Originally Posted by gio001
Hello everyone,
I have a quick question about the select command in ksh. I am using it to define a menu for user selection, I have found that the REPLY var contains the input from the user, I was interested to find out if there is a system variable that contains the whole menu as an array, the reason being that I would like the user to be allowed multiple selections from the menu, at that point all of those would be in $REPLY as a sequence of numbers, still I would like to resolve those numbers to what selection they all were in the menu.
Thanks.
Why don't you define the menu in an array before invoking select and using the array as the argument to select?

t
# 3  
Old 08-05-2008
Great idea

Thanks for the great idea. I knew I could count on you guys to come to the rescue . . . .
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Select command

Hi I'm using the "select" command in the global_env.sh to log in to the application directory. This file is called in .bashrc profile. Sample code: Filename: global_env.sh set -o vi export severname=$(uname -n) printf '%s\n%30s\n%s\n' "***********************" "Welcome to $severname"... (6 Replies)
Discussion started by: cheers799
6 Replies

2. Shell Programming and Scripting

Select / Print odd-even elements of an array

Hello experts, I wish to print the contents of odd-even numbered indices of an array. The problem statement is as follows : 1. The first line contains an integer, (the number of test cases). 2. Each line of the subsequent lines containing a string. Example: 2 Haider Bash ... (4 Replies)
Discussion started by: H squared
4 Replies

3. Shell Programming and Scripting

SQLPLUS command with more than 1 select statement

Hi all, I'm using below code processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS whenever sqlerror exit sql.sqlcode; set head off feedback off echo off pages 0 SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}' ... (8 Replies)
Discussion started by: Pratiksha Mehra
8 Replies

4. Shell Programming and Scripting

Select command help with blank input value

I have a select menu driven script using a case statment and cannot control what happens after a user's input is just <ENTER> or the <SPACEBAR>+<ENTER>. I want it to just hit the "MAIN" function and not redraw the options. I've look everywhere for the answer and am at a loss. Here's the code:... (4 Replies)
Discussion started by: ambroze
4 Replies

5. UNIX for Dummies Questions & Answers

Select Command - return

Hello everyone, A simple question which may have a suggested solution: I am using, and loving, the select command in a ksh93 script on AIX 6.1 to present users with menus. I have been successful in controlling all of key input by the users, I still have an issue with the RETURN key. When the... (4 Replies)
Discussion started by: gio001
4 Replies

6. Shell Programming and Scripting

How to use select into command in shell script?

I need to get total number of rows in a table by using select count(*) from table and need to assign into a variable in shell script. I used the following script, it does return the number of rows but also with oracle headers, Please help me to eliminate this headers. Shell Script #!/bin/sh... (16 Replies)
Discussion started by: vel4ever
16 Replies

7. Shell Programming and Scripting

for each value in an array, execute select statement

Hello All, I am new to shell scripting. I am working on Solaris O/S, bash script and sybase programming. I want to loop through multiple values in an array and for each value, I want to select a row from the database. following is the code written for it. output="loop.csv" ... (8 Replies)
Discussion started by: arundhati_s
8 Replies

8. Shell Programming and Scripting

Select multiple values from an Oracle database and assign it to two dimensional array

hi I have two tables in oracle DB and am using a joining query which will result in the output as follows. i need to assign it to a two dimensional array and use it for my further calculations. the way i tried is as follows. #!/bin/ksh export... (1 Reply)
Discussion started by: aemunathan
1 Replies

9. 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

10. UNIX for Dummies Questions & Answers

Command to select files with different extensions

I want to select files which have different extensions such as .cpp, .cs, .h I can select one of them as find . -name "*.cpp" but I want to select all of them in one command only. It should be pretty simple but I'm not able to get it. Any help with the command will be greatly appreciated. (1 Reply)
Discussion started by: MobileUser
1 Replies
Login or Register to Ask a Question