Sponsored Content
Full Discussion: Associative arrays
Top Forums Shell Programming and Scripting Associative arrays Post 302329426 by kshji on Saturday 27th of June 2009 01:53:22 PM
Old 06-27-2009
You need always parse line twice if you like to use variable which value is in variable.
eval is answer = parse command line twice

simple example:
Code:
varname=var1
var1=100
eval print \$$varname
#1st parse give command line to run: print $var1
#2nd parse give command line to run: print 100

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Associative Array

Hi, I am trying to make an associative array to use in a popup_menu on a website. Here is what i have: foreach $entr ( @entries ) { $temp_uid = $entr->get_value(uid); $temp_naam = $entr->get_value(sn); $s++; } This is the popup_menu i want to use it in. popup_menu(-name=>'modcon',... (4 Replies)
Discussion started by: tine
4 Replies

2. UNIX for Dummies Questions & Answers

are Associative Arrays possible in UNIX?

Is it possible to say.. myArr=34 myArr=15 ? (11 Replies)
Discussion started by: yongho
11 Replies

3. UNIX for Dummies Questions & Answers

Unable to understand associative nature of awk arrays

About associative nature of awk arrays i'm still confused, not able to understand yet how array element can be accessed based on a string, I got one example at gawk manual to illustrate associative nature of awk arrays, it goes here: Codeawk ' # Print list of word frequencies { for (i = 1;... (3 Replies)
Discussion started by: nervous
3 Replies

4. Shell Programming and Scripting

associative arrays?

Hello, i'm writing a little script that checks a .txt file for a specific ID that came after 9:10 am which outputs it's data to a file LateUsers.txt once done , it should mention the following: Number of late users Number of unique late users Over all late users percentage number of... (0 Replies)
Discussion started by: rollyah
0 Replies

5. Programming

question about int arrays and file pointer arrays

if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies

6. UNIX for Dummies Questions & Answers

Using associative arrays with an if statement

I have this piece of code. The first if statement is not working, however the second if statement is working fine. I have set a value for Srcs to be file.srcs and want to print it. If no value for Rcvs is set, I get the print statement correctly hasValue="file.srcs" if ${hasValue}; then ... (0 Replies)
Discussion started by: kristinu
0 Replies

7. Shell Programming and Scripting

Improving code by using associative arrays

I have the following code, and I am changing it to #!/bin/bash hasArgumentCModInfile=0 hasArgumentSrcsInfile=0 hasArgumentRcvsInfile=0 OLDIFS="$IFS" IFS="|=" # IFS controls splitting. Split on "|" and "=", not whitespace. set -- $* # Set the positional... (3 Replies)
Discussion started by: kristinu
3 Replies

8. Shell Programming and Scripting

Associative array

I have an associative array named table declare -A table table="fruit" table="veggie" table="GT" table="eminem" Now say I have a variable returning the value highway How do I find corresponding value GT ?? (this value that I find (GT in this case) is supposed to be the name of a mysql... (1 Reply)
Discussion started by: leghorn
1 Replies

9. Shell Programming and Scripting

Associative arrays awk

Hi, I have the following dataset. A 2 1 272 A 2 2 333 A 2 3 222 A 3 1 222 A 3 2 11 B 1 1 112 B 1 2 998 B 2 1 667 C 1 1 887 C 1 2 887 C 2 1 998 I need to have an associate array based on the first column and generate a auto generated number column in the last column. Needed output:... (2 Replies)
Discussion started by: mitt
2 Replies

10. Shell Programming and Scripting

Using associative array for comparison

Hello together, i make something wrong... I want an array that contains information to associate it for further processing. Here is something from my bash... You will know, what I'm trying to do. I have to point out in advance, that the variable $SYSOS is changing and not as static as in my... (2 Replies)
Discussion started by: Decstasy
2 Replies
SPYDR(1)						      General Commands Manual							  SPYDR(1)

NAME
spydr - GUI for Image display and analysis with yorick SYNOPSIS
Spydr (pronounce spider) can be invoqued from the shell spydr [ options ] image1.fits [ image2.fits ... ] where the fits images can contain single images (not necessarily of the same size) or data cube. Widlcards are allowed in names. or within yorick #include spydr.i spydr,im1,im2,cube spydr,"image1.fits",... COMMAND LINE OPTIONS
--conf file configuration file. --hdu value Specify a fits HDU to read --dpi value Yorick dpi value (yorick default = 75, spydr default = 83). Any value between 30 and 150 make sense. --itt value Intensity Transfer Table (1=linear, 2=sqrt, 3=square, 4=log, 5=hist equalized) --pixsize value Pixel size (or plate scale) in arcsec. --boxsize value Size of box for PSF fitting and Strehl calculation (pixels) --saturation value Value above which pixels have to be considered as saturated (ADU) --wavelength value Force wavelength for all images --zeropoint value Photometric zeropoint (magnitude) --nbins value Number of bins for histograms --strehlaper value Diameter of circular mask for Strehl calculations (pixels). The flux is integrated in a circle of this diameter, while the sky is estimated from the remaining pixels within the box of size "boxsize" --batch Turn on yorick batch mode (yorick quits when encountering an error). This flag is recommended when starting spydr from a non-inter- active session (e.g. from a gnome applet). --debug Turn on the verbose mode (debugging mode). --invert Invert LUT --fullgui Show the plugin pane when the GUI is realized --compact Hide the lower part of the GUI at startup DESCRIPTION
Spydr is a GUI for image visualization and simple analysis (cuts, zoom, values, statistics, histogram, sigma filter) with changeable LUT and ITT. Spydr has a couple of plugins to measure FWHM and Strehl. Press "?" on the main display area to get a popup help: The following shortcuts are available: x/y: Plot line/column under cursor X/Y: Toggle continuous plot of line/column under cursor c: Interactive plot of cut across image h: Plot histogram of visible region r: Radial plot centered on cursor f: Fit 1d gaussian to 1d plot e: Adjust min and max cut to 10% and 99.9% of distribution E: Reset min and max cut to min and max of visible region n/p: Next/prevous image s: Sigma filter displayed image -/+: Decrease/Increase zoom factor in zoom window ?: This help EXAMPLES
From the shell: $ spydr --dpi 74 --fullgui 20070730_2*.fits $ spydr --pixsize 0.127 20070730_2[2-3]?.fits 20070730_241.fits Within yorick: > spydr,"~/ascam/2007jun26/20070625T2000*.fits" > spydr,["20070730_1[1-3].fits","20070730_23.fits"] > spydr,image > spydr,[im1,im2] > spydr,im1,im2 ENVIRONMENT VARIABLES
Y_PYTHON Force the path to spydr.py. The default path is ./:Y_USER:Y_USER/python/:Y_SITES/python/:Y_SITE/python/ Y_GLADE Force the path to spydr.glade. The default path is ./:Y_USER:Y_USER/glade/:Y_SITES/glade/:Y_SITE/glade/ Y_CONF Force the path to spydr.conf. The default path is ./:Y_USER:Y_SITE:/etc/: ./share/:Y_USER/share/:Y_SITE/share/: ./share/spydr/:Y_USER/share/spydr/:Y_SITE/share/spydr/ RESTRICTIONS AND BUGS
- only fits images handled to date - the ITT display is not very well handled AUTHOR
Francois Rigaut, Gemini Observatory FILES
Input files: spydr.conf The spydr configuration file. Needed. It should have come with your installation. The routine which_spydrconf() returns the path to the used spydr.conf. The following directories are searched for spydr.conf, in this order: Y_USER, Y_SITE, /etc, Y_USER/share, Y_SITE/share, Y_USER/share/spydr, Y_SITE/share/spydr. If you wish to modify the defaults, copy the file over to Y_USER and modify at will. Output files: none. SEE ALSO
yorick(1), yao(1) 4th Berkeley Distribution 2008 January 02 SPYDR(1)
All times are GMT -4. The time now is 09:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy