Sponsored Content
Full Discussion: Dynamic variable values
Top Forums UNIX for Dummies Questions & Answers Dynamic variable values Post 302213886 by fpmurphy on Friday 11th of July 2008 08:58:46 AM
Old 07-11-2008
One way ...
Code:
AAA_IP_ADD="1.1.1.1"
BBB_IP_ADD="2.2.2.2"

SUPPLIER="BBB"

eval IPADDR='$'{${SUPPLIER}_IP_ADD}
echo $IPADDR

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting dynamic values

Hi, I am stuck with extracting values by combining 2 dynamically extracted values. The code goes like this #!/usr/bin/ksh ID1="abcd" i=1 #this is a dynamic value and keeps on changing b="ID" #this is static now i want the value of ID1 variable. like echo $b$i But echo... (1 Reply)
Discussion started by: chaitanyapn
1 Replies

2. Shell Programming and Scripting

Assigning values for a dynamic array for an input

Hello, Can somebody please give me a snippet for the below requirement. I want to assign the values separeted by a comma to be assigned to a dynamic array. If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below... (2 Replies)
Discussion started by: suneelj
2 Replies

3. Shell Programming and Scripting

Assigning values to reference variables for a dynamic menu driven script.

How do I assign values to reference variables? I am assigning a variable name to --> $user_var Then I am trying to change its underlying variable value by $((user_var))=$user_value .. its failing,, Please let me know if there is a way to do this dynamically.. FileA.props... (5 Replies)
Discussion started by: kchinnam
5 Replies

4. Shell Programming and Scripting

dynamic variable name

I found one post in another site with a solution for my problem the below solution should explain what I want. #!/bin/sh first="one" second="two" third="three" myvar="first" echo ${!myvar} But this gives error 'bad substitution' System info SunOS sundev2 5.9... (3 Replies)
Discussion started by: johnbach
3 Replies

5. Shell Programming and Scripting

dynamic values in a row

hi i have an input file in which there are diffrent values for xxxx,yyyyyy,zzzzzzz how can i arrange the dynamic values of x,y&z in a row. input file: xxxxx 1 yyyyyy 4 yyyyyy 5 zzzzzzzz 7 yyyyyy 13 zzzzzzzz 7 zzzzzzzz 6 yyyyyy 14 yyyyyy 12 zzzzzzzz 4 yyyyyy 4 yyyyyy 5 yyyyyy 6... (6 Replies)
Discussion started by: dodasajan
6 Replies

6. Shell Programming and Scripting

Using dynamic arrays to extract the values

Hi all, We have requirement to generate load timing based on subject areas HOUSEHOLD, BANKING and TRADING. These values are stored in an array SUB_ARR SUB_ARR=("HOUSEHOLD" "BANKING" "TRADING") Based on indicator files produced while processing data for each type, we need to get the stats (using... (2 Replies)
Discussion started by: sanjaydubey2006
2 Replies

7. Shell Programming and Scripting

Passing dynamic variable within another variable.

I have a small program which needs to pass variable dynamically to form the name of a second variable whose value wil be passed on to a third variable. ***************** Program Start ****************** LOC1=/loc1 PAT1IN=/loc2 PAT2IN=/loc3 if ; then for fpattern in `cat... (5 Replies)
Discussion started by: Cyril Jos
5 Replies

8. Shell Programming and Scripting

How to lowercase the values in a column in awk and include a dynamic counter?

Hi, I am trying to incorporate 2 functions into my `awk` command. I want to lower case Column 2 (which is essentially the same information in Col1, except in Col1 I want to maintain the capitalization) and I want to count from 0-N that begins and ends with the start of certain markers that I... (6 Replies)
Discussion started by: owwow14
6 Replies

9. Shell Programming and Scripting

Replace sql with dynamic values

Hi Guys, I am using a function to replace the values dynamically to frame sql query by reading a file. My file will have column names like file.txt col_1 col_2 expected output: select id,col_1,col_2 from ( select a.id, a.col_1, rank() over (ORDER BY cast(a.col_1 AS double)... (5 Replies)
Discussion started by: Master_Mind
5 Replies

10. Shell Programming and Scripting

Cut command with dynamic passing of delimiter and position values

Hi All, We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string. ex. echo "A,B,C,D,E" |cut -d "," -f3 echo "A|B|C|D|E"|cut -d "|" -f2 Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
IWSPY(8)                                                     Linux Programmer's Manual                                                    IWSPY(8)

NAME
iwspy - Get wireless statistics from specific nodes SYNOPSIS
iwspy [interface] iwspy interface [+] DNSNAME | IPADDR | HWADDR [...] iwspy interface off iwspy interface setthr low high iwspy interface getthr DESCRIPTION
Iwspy is used to set a list of addresses to monitor in a wireless network interface and to read back quality of link information for each of those. This information is the same as the one available in /proc/net/wireless : quality of the link, signal strength and noise level. This information is updated each time a new packet is received, so each address of the list adds some overhead in the driver. Note that this functionality works only for nodes part of the current wireless cell, you can not monitor Access Points you are not associ- ated with (you can use Scanning for that) and nodes in other cells. In Managed mode, in most case packets are relayed by the Access Point, in this case you will get the signal strength of the Access Point. For those reasons this functionality is mostly useful in Ad-Hoc and Mas- ter mode. PARAMETERS
You may set any number of addresses up to 8. DNSNAME | IPADDR Set an IP address, or in some cases a DNS name (using the name resolver). As the hardware works with hardware addresses, iwspy will translate this IP address through ARP. In some case, this address might not be in the ARP cache and iwspy will fail. In those case, ping(8) this name/address and retry. HWADDR Set a hardware (MAC) address (this address is not translated & checked like the IP one). The address must contain a colon (:) to be recognised as a hardware address. + Add the new set of addresses at the end of the current list instead of replacing it. The address list is unique for each device, so each user should use this option to avoid conflicts. off Remove the current list of addresses and disable the spy functionality setthr Set the low and high signal strength threshold for the iwspy event (for drivers that support it). Every time the signal strength for any of the address monitored with iwspy goes lower than the low threshold or goes higher than the high threshold, a Wireless Event will be generated. This can be used to monitor link outages without having to run iwspy periodically. getthr Retrieve the current low and high signal strength threshold for the iwspy event. FILES
/proc/net/wireless SEE ALSO
iwconfig(8), iwlist(8), iwevent(8), iwpriv(8), wireless(7). net-tools 31 October 1996 IWSPY(8)
All times are GMT -4. The time now is 05:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy