Sponsored Content
Full Discussion: array to choices .. lost
Top Forums Shell Programming and Scripting array to choices .. lost Post 302381914 by vgersh99 on Monday 21st of December 2009 11:22:48 AM
Old 12-21-2009
Code:
#!/bin/ksh

PS3='Enter your number of choices> '

select i in *
do
  echo "you have chosen [${REPLY}] for file [${i}]"
done

 

4 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Lost Data Lost Admin

First time so excuse my ignorance please. I may not be accurately describing the issue. I have inherited a small lab mostly SUN V120s. We lost power and are trying to recover. Nope no backups... The primary issue I have is 1 box is an Oracle Server. It has 2 36Gb harddrives. I am able to... (3 Replies)
Discussion started by: murphsr
3 Replies

2. Shell Programming and Scripting

Generating a list of choices in a menu

Hello all, I have the below script and I'm a little stuck on the best way to continue. Essentially I'm creating a text file (systems.txt) with a list of servers in it by hostname. Then I would like to echo a menu with each hostname and a number to use to pick it from the list. It's somehow... (7 Replies)
Discussion started by: sysera
7 Replies

3. Shell Programming and Scripting

Attempting to pass my array as a nested parameter to loop. A little lost.

I want to pass this array as a parameter. IFS=$'\n' fortune_lines=($(fortune | fold -w 30 )) Inside of this line screen -p 0 -S ${SCREEN_SESSION} -X stuff "`printf "say ${fortune_lines}\r"`" And I am lost at this point. I am thinking something like this? Then make it loop.. ... (7 Replies)
Discussion started by: briandanielz
7 Replies

4. Solaris

Lost out-of-band communication with 2540 Array

Hello Dears, My server hots cannot contacted my array disk 2540 by using out-of-band Ethernet Cable. The Controller Ethernet port is off , I replace the ethernet cable but not OK I reboot the server and the Array disk 2540 but Not OK. Please somebody know how to solve this issue? ... (1 Reply)
Discussion started by: ghislino
1 Replies
BrowseEntry(3)						User Contributed Perl Documentation					    BrowseEntry(3)

NAME
Tk::BrowseEntry - entry widget with popup choices. SYNOPSIS
use Tk::BrowseEntry; $b = $frame->BrowseEntry(-label => "Label", -variable => $var); $b->insert("end", "opt1"); $b->insert("end", "opt2"); $b->insert("end", "opt3"); ... $b->pack; SUPER-CLASS The "BrowseEntry" class is derived from the "Frame" class and inherits all the methods, options and subwidgets of its super-class. By default, options and methods are delegated to the entry subwidget. DESCRIPTION
BrowseEntry is a poor man's ComboBox. It may be considered an enhanced version of LabEntry which provides a button to popup the choices of the possible values that the Entry may take. BrowseEntry supports all the options LabEntry supports except -textvariable. This is replaced by -variable. Other options that BrowseEntry supports: -arrowimage Specifies the image to be used in the arrow button beside the entry widget. The default is an downward arrow image in the file cbxarrow.xbm -autolimitheight If set to a true value, then the height of the listbox will be at most the number of entries in the list. The overall maximum of "-listheight" still applies. -autolistwidth If set to a true value, then the width of the listbox will match the width of the largest entry. -browsecmd Specifies a function to call when a selection is made in the popped up listbox. It is passed the widget and the text of the entry selected. This function is called after the entry variable has been assigned the value. -browse2cmd Like "-browsecmd", but the callback is called with the listbox index instead of the selected value. -buttontakefocus Set the "-takefocus" option of the button subwidget. -choices Specifies the list of choices to pop up. This is a reference to an array of strings specifying the choices. -colorstate The state of the widget is reflected by color. A non-editable entry widget will get a light gray background, while an editable entry will be almost white. [This may change] -listcmd Specifies the function to call when the button next to the entry is pressed to popup the choices in the listbox. This is called before popping up the listbox, so can be used to populate the entries in the listbox. -listheight Set the height of the listbox. See also "-autolimitheight". -listwidth Specifies the width of the popup listbox. -state Specifies one of three states for the widget: normal, readonly, or disabled. If the widget is disabled then the value may not be changed and the arrow button won't activate. If the widget is readonly, the entry may not be edited, but it may be changed by choosing a value from the popup listbox. normal is the default. -style Set the "style" of the widget. Permitted values are "MSWin32" and "unix". By default "-style" is set to the current platform. Widgets with the "unix" style will look like a normal "BrowseEntry" widget, whereas with the "MSWin32" style the arrow will look close to the Windows' standard combobox widget, while moving the mouse the entries will be highlighted, and probably includes other changes. -variable Specifies the variable in which the entered value is to be stored. METHODS
insert(index, string) Inserts the text of string at the specified index. This string then becomes available as one of the choices. delete(index1, index2) Deletes items from index1 to index2. get The get method is delegated to the choices listbox. ADVERTISED WIDGETS
The following widgets are advertised: entry The entry widget. arrow The button with the arrow image. choices The toplevel widget containing the choice listbox. slistbox The scrolled listbox with the choices. SUBCLASSING
To make subclassing easier, the following methods may be overridden to use other standard widgets in composing the mega widget: LabEntryWidget A widget class compatible with Tk::LabEntry used for the entry. ButtonWidget A widget class compatible with Tk::Button used for the arrow button. ListboxWidget A widget class compatible with Tk::Listbox used for the choices listbox. For example to use a "NumEntry" widget (from the Tk-GBARR CPAN distribution) instead of the normal "Entry" widget: package Tk::NumBrowseEntry; use base qw(Tk::BrowseEntry); use Tk::NumEntry; Construct Tk::Widget 'NumBrowseEntry'; sub LabEntryWidget { "NumEntry" } BUGS
BrowseEntry should really provide more of the ComboBox options. AUTHOR
Rajappa Iyer rsi@earthling.net Chris Dean ctdean@cogit.com made additions. More additions by Slaven Rezic slaven@rezic.de This code was inspired by ComboBox.tcl in Tix4.0 by Ioi Lam and bears more than a passing resemblance to ComboBox code. This may be distributed under the same conditions as Perl. perl v5.16.3 2014-06-10 BrowseEntry(3)
All times are GMT -4. The time now is 01:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy