Sponsored Content
Top Forums UNIX for Dummies Questions & Answers select in ksh, any guidance for bash? Post 21057 by thehoghunter on Thursday 9th of May 2002 12:40:01 PM
Old 05-09-2002
According to the man page on bash it uses select also.

User Commands BASH(1)

select name [ in word ] ; do list ; done
The list of words following in is expanded, generating
a list of items. The set of expanded words is printed
on the standard error, each preceded by a number. If
the in word is omitted, the positional parameters are
printed (see PARAMETERS below). The PS3 prompt is then
displayed and a line read from the standard input. If
the line consists of a number corresponding to one of
the displayed words, then the value of name is set to
that word. If the line is empty, the words and prompt
are displayed again. If EOF is read, the command com-
pletes. Any other value read causes name to be set to
null. The line read is saved in the variable REPLY.
The list is executed after each selection until a break
or return command is executed. The exit status of
select is the exit status of the last command executed
in list, or zero if no commands were executed.
thehoghunter
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

Hi, I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh). The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies

3. UNIX for Dummies Questions & Answers

bash preferred or ksh with bash features

I'm a user on a fairly locked down sys V server. By default, I have ksh set as my default shell. I added to my .profile: bash -o vi so when I login, it goes into bash so I can take advantage of tab completion and use the up key to bring up previous commands. However, whenever I want to exit, I... (2 Replies)
Discussion started by: mrwatkin
2 Replies

4. Shell Programming and Scripting

Select columns from a matrix given within a range in BASH

I have a huge matrix file which looks like this (example matrix): 1 2 3 5 4 5 6 7 7 6 8 9 1 2 4 2 7 6 5 1 3 2 1 9 As one can see, this matrix has 4 columns and 6 rows. But my original matrix has some 3 million rows and 6000 columns. For example, on this matrix I can define my task as... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

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

6. Shell Programming and Scripting

To select a script name till .ksh or .sh

Hi All, My requirement is to search for a Table Name being used in list of script placed at a dir path : we are using below command to get the desired result : grep -H -i <Table_name> <dir_path>/* -r|awk '{print $1}'| uniq -d #It gives me below result ... (3 Replies)
Discussion started by: sanjaydubey2006
3 Replies

7. UNIX for Dummies Questions & Answers

Select the latest dated file-ksh script

Hello all!! I am new here and new in scripting! I want to write a ksh script to select the most recent file from a dir and use it in a variable. I have a directory with files named like: YYYMMDD A basic idea of the script I want to write is #!/usr/bin/ksh latest= latest_dated_file at... (2 Replies)
Discussion started by: chris_euop
2 Replies

8. Shell Programming and Scripting

How to use a multiple line list with the select command in ksh?

I copied the below program to play around with displaying a list of items using the select command in ksh. When I put all items in the same line, it works fine. I am trying to use multiple lines instead of a single row...my list is too large for a single line. How do I get the line continuation... (3 Replies)
Discussion started by: haganator
3 Replies

9. Shell Programming and Scripting

Bash to select and save file in new directory

I am trying to select a file in bash and save it to a directory. The below does run but no selected file is saved. Thank you :). bash # select file printf "please select a file to analyze with entered gene or genes \n" select file in $(cd... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. Shell Programming and Scripting

Bash to select text and apply it to a selected file in bash

In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :) ... (4 Replies)
Discussion started by: cmccabe
4 Replies
shells(4)							   File Formats 							 shells(4)

NAME
shells - shell database SYNOPSIS
/etc/shells DESCRIPTION
The shells file contains a list of the shells on the system. Applications use this file to determine whether a shell is valid. See getuser- shell(3C). For each shell a single line should be present, consisting of the shell's path, relative to root. A hash mark (#) indicates the beginning of a comment; subsequent characters up to the end of the line are not interpreted by the routines which search the file. Blank lines are also ignored. The following default shells are used by utilities: /bin/bash, /bin/csh, /bin/jsh, /bin/ksh, /bin/pfcsh, /bin/pfksh, /bin/pfsh, /bin/sh, /bin/tcsh, /bin/zsh, /sbin/jsh, /sbin/sh, /usr/bin/bash, /usr/bin/csh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/pfcsh, /usr/bin/pfksh, /usr/bin/pfsh, and /usr/bin/sh, /usr/bin/tcsh, /usr/bin/zsh. Note that /etc/shells overrides the default list. Invalid shells in /etc/shells may cause unexpected behavior (such as being unable to log in by way of ftp(1)). FILES
/etc/shells lists shells on system SEE ALSO
vipw(1B), ftpd(1M), sendmail(1M), getusershell(3C), aliases(4) SunOS 5.10 4 Jun 2001 shells(4)
All times are GMT -4. The time now is 06:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy