Sponsored Content
Full Discussion: Issue with Lists
Top Forums Shell Programming and Scripting Issue with Lists Post 302897040 by jakelawson44 on Thursday 10th of April 2014 03:19:28 PM
Old 04-10-2014
haha sorry, I'm doing this based on an exercise online. I copied and pasted the reference instead of my actual code. I corrected the spelling in mine :P

and what do you mean check the equals?

---------- Post updated at 02:19 PM ---------- Previous update was at 02:15 PM ----------

lemme redirect at this:

I wrote my own little script to isolate the problem, and I'm finding the same issue

Code:
#!/bin/bash

LIST="One Two Three"

select OPT in $LIST; do
if [ $OPT="One" ]; then
       echo "You chose one!"
elif [ $OPT="Two" ]; then
       echo "You chose two!"
elif [ $OPT="Three" ]; then
       echo "You chose three!"
fi
exit
done



this is giving me the same issue of echoing "You chose one!" regardless of my choice.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question on lists

I'm fairly new to shell scripting and would like to know if what I am seeking to do is possible in shell. I'm trying to make a list of strings. The list will be looped through and each member of the list will be used to pass a parsing option to python. My script looks something like this: ... (3 Replies)
Discussion started by: Nacre
3 Replies

2. AIX

grep using lists?

I have a file that contain a list of files. How can I use grep to search the files in the list for a specific pattern? (2 Replies)
Discussion started by: bbbngowc
2 Replies

3. Shell Programming and Scripting

How to get the files lists

Hi All, Need the help in getting the file list which are generated for the time period. example if i want to get the list of file generated between 11 to 12 clock. i used the find command search the files with -cmin flag with -60. find /home/test/* -cmin -60 -type f -exec ls {} \; ... (2 Replies)
Discussion started by: nmadhuhb
2 Replies

4. Shell Programming and Scripting

Shell Script to Create non-duplicate lists from two lists

File_A contains Strings: a b c d File_B contains Strings: a c z Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below. Resultant... (7 Replies)
Discussion started by: mlv_99
7 Replies

5. Shell Programming and Scripting

Using foreach with two lists

Hi everybody, I'm trying to use a foreach command with two lists. The file.txt looks like this: var1: 100 200 300 var2: 3 6 9 I'm trying to use a foreach command to associate the two variables together. My script looks like this: #! /bin/tcsh set a=(`cat file.txt | grep 'var1' | cut -d... (8 Replies)
Discussion started by: SimonWhite
8 Replies

6. Shell Programming and Scripting

combining two lists

Hi, So I I received two lists for my merchandise and both are similar but differences do occur. I want to combine two lists that have similar names but I dont want the similar name to come up twice because I will end up purchasing two of those items. Heres an example below (file is massive). ... (1 Reply)
Discussion started by: kylle345
1 Replies

7. Shell Programming and Scripting

get the lists

I expert, I may cross post something similar but I dirtyed my quesion somehow to be clear in the thread #cat file1 88dee gcc: Grok for callconvention-hard to enable hard float a2ad2 eglibc: package mtrace separately 61487 python: bump PR of packages after update of distutils.bbclass... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

8. UNIX for Dummies Questions & Answers

Lists in awk

Hi togehter! I would like to write an awk script which prints the first column divided by the sum of the second column: So if this is my list 1 2 2 1 3 1 4 1 it should print a list like this: 1/5 2/5 3/5 4/5 My idea was to use END like this: (3 Replies)
Discussion started by: bjoern456
3 Replies

9. Shell Programming and Scripting

Combining lists

Hello everybody. My operating system is Fedora30, shell - bash I faced combining lists. I will be glad for help regarding strings, arrays and so on. The bottom line is as follows. It is necessary to combine each element from the first list with elements from the second. if the second is longer... (4 Replies)
Discussion started by: nezabudka
4 Replies
shelltool(1)						      General Commands Manual						      shelltool(1)

NAME
shelltool - run a shell (or other program) in an OpenWindows terminal window SYNOPSIS
shelltool [ -C ] [ -B boldstyle ] [ -I command ] [ generic-tool-arguments ] [ program [ arguments ] ] AVAILABILITY
This command is available with the OpenWindows user environment, For information about installing OpenWindows, refer to the OpenWindows Installation and Start-Up Guide. DESCRIPTION
shelltool is a standard OpenWindows facility for shells or other programs that use a standard tty-based interface. When invoked, shelltool runs a program, (usually a shell) in an interactive terminal emulator based on a tty subwindow. Keyboard input is passed to that program. In the OpenWindows version of shelltool, a restricted pop-up menu is available from the main display area that allows you to enable scrolling. Selecting the Enable Scrolling option from the restricted menu gives shelltool the full functionality of the cmdtool window, included a larger pop-up menu from which to select options. Selecting Disable Scrolling from the pop-up submenu will return Shelltool to its original state. OPTIONS
-C Redirect system console output to this shelltool. -B boldstyle Set the style for displaying bold text to boldstyle. boldstyle can be a string specifying one of the choices for the term.boldstyle default, see Defaults Options, below, or it may be a numerical value for one of those choices, from 0 to 8, corresponding to the placement of the choice in the list. -I command Pass command to the shell. SPACE characters within the command must be escaped. generic-tool-arguments shelltool accepts the generic tool arguments listed in xview(1). USAGE
.Xdefaults File Options You can specify a number of defaults using the options in the .Xdefaults file that effect the behavior of shelltool. The ones of interest are those that begin with text,term, or keyboard. See .xview(1) for more detailed information. The Terminal Emulator The tty subwindow is a terminal emulator. Whenever a tty subwindow is created, the startup file ~/.ttyswrc is read for initialization parameters that are specific to the tty subwindow. The .ttyswrc File The command format for this file is: # Comment. set variable Turn on the specified variable. mapi key text When key is typed pretend text was input. mapo key text When key is typed pretend text was output. The only currently defined variable is pagemode. key is one of L1-L15, F1-F15, T1-T15, R1-R15, LEFT , or RIGHT (see note below). text may contain escapes such as E, , ^X, etc. (ESC, RETURN , and CTRL-X , respectively). See termcap(5) for the format of the string escapes that are recognized. Note: mapi and mapo may be replaced by another keymapping mechanism in the future. When using the default kernel keyboard tables, the keys L1, LEFT , RIGHT , BREAK , R8, R10, R12, and R14 cannot be mapped in this way; they send special values to the tty subwindow. Also, when using the default kernel keyboard tables, L1-L10 are now used by XView. See input_from_defaults(1) and kbd(4S) for more information on how to change the behavior of the keyboard. It is possible to have terminal-based p special escape sequences. These escape sequences may also be sent by typing a key appropriately mapped using the mapo function described above. The following functions pertain to the tool in which the tty subwindow resides, not the tty subwindow itself. E[1t - open E[2t - close (become iconic) E[3t - move, with interactive feedback E[3;TOP;LEFTt - move, to TOP LEFT (pixel coordinates) E[4t - stretch, with interactive feedback E[4;HT;WIDTHt - stretch, to HT WIDTH size (in pixels) E[5t - front E[6t - back E[7t - refresh E[8;ROWS;COLSt - stretch, to ROWS COLS size (in characters) E[11t - report if open or iconic by sending E[1t or E[2t E[13t - report position by sending E[3;TOP;LEFTt E[14t - report size in pixels by sending E[4;HT;WIDTHt E[18t - report size in characters by sending E[8;ROWS;COLSt E[20t - report icon label by sending E]LlabelE E[21t - report tool header by sending E]llabelE E]ltextE - set tool header to text E]IfileE - set icon to the icon contained in file; file must be in iconedit output format E]LlabelE - set icon label to label E[>OPT;...h - turn SB OPT on (OPT = 1 => pagemode), for example, E[>1;3;4h E[>OPT;...k - report OPT; sends E[>OPTl or E[>OPTh for each OPT E[>OPT;...l - turn OPT off (OPT = 1 => pagemode), for .B E[>1;3; See EXAMPLES for an example of using this facility. shelltool Windows The window created by shelltool is based on the text facility that is described in the textedit man page. The user is given a prompt at which to type commands and pop-up menus from which to select command options. shelltool windows support cursor motions, using an /etc/termcap entry called sun-cmd. Command windows automatically set the TERM environ- ment variable to sun-cmd. So, if you rlogin(1C) to a machine that does not have an entry for sun-cmd in its /etc/termcap file, the error message `Type sun-cmd unknown' results. To rectify this, type the command `set TERM=sun'. Programs written using the curses(3X) or curses(3V) library packages will work in a command window, but programs hard-coded for sun-type terminals may not. When supporting a pro- gram that performs cursor motions, the command window automatically takes on the characteristics of a tty window (as with shelltool(1)). When that program terminates or sleeps, the full command window functionality is restored. cmdtool supports programs that use CBREAK and NO ECHO terminal modes. This support is normally invisible to the user. However, programs that use RAW mode, such as rlogin(1C) and script(1), inhibit command-line editing with the mouse. In this case, however, tty-style ERASE, word-kill and line-kill characters can still be used to edit the current command line. The shelltool Menu The shelltool window menu is called the Term Pane menu and contains the following options and their submenus: Enable Page Mode Enables page mode within shelltool . Copy Places the highlighted text on the clipboard. PastePuts the contents of pointed to by the cusor. Scrolling Enables scrolling within shelltool . EXAMPLES
The following aliases can be put into your ~/.cshrc file: alias header 'echo -n "E]l!*E"' alias iheader 'echo -n "E]L!*E"' alias icon 'echo -n "E]I!*E"' FILES
~/.ttyswrc /usr/lib/ttyswrc /usr/bin/xview/shelltool /usr/demo 11 June 1990 shelltool(1)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy