Sponsored Content
Full Discussion: Dynamic variables and eval
Top Forums Shell Programming and Scripting Dynamic variables and eval Post 302414767 by yonderboy on Wednesday 21st of April 2010 02:11:39 AM
Old 04-21-2010
Thanks very much both! My eval code now works....

I now see what you mean about using arrays instead of counters....I am going to do that. Very longsighted of you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic variables within shell script

Hi Gurus, I have a requirement of writting the shell script where it should ask me two values FND_TOP=/d02/app/oracle/xxx/fnd/11.5.0 CDCRM_TOP=/d02/app/oracle/xxx/cdcrm/11.5.0 and then keep these values stored as variables for the execution of rest of the script. Because, I have to... (2 Replies)
Discussion started by: isingh786
2 Replies

2. UNIX for Dummies Questions & Answers

dynamic variables

I am new to unix and the following problem is bugging me.:confused: var1="hello1" var2="hello2" var3="hello3" counter=1 while do echo $var$counter done the idea here is to display the value of "var" based on the counter. I am using the korn shell. I used array here but the... (4 Replies)
Discussion started by: max_payne1234
4 Replies

3. Programming

global variables and dynamic allocation

Hi, is it possible in C to allocate dynamically a global variable?? (3 Replies)
Discussion started by: littleboyblu
3 Replies

4. Shell Programming and Scripting

Problem with dynamic variables outside the loop

Hi All, Shell is ksh I've given portion of the script here to explain the problem. It will accept 2 input parameters . in_file1=$1 in_file2=$2 outbound_dir=/home/outbound for i in 1 2 do eval file$i=$outbound_dir/\$in_file$i eval echo "filename is \$file$i" ... (4 Replies)
Discussion started by: kk17
4 Replies

5. Shell Programming and Scripting

dynamic variables - eval - expand etc.

Hello, so i'm making a script, using dynamic variables and trying to expand them. So far it hasn't worked out too well so it seems that I need some help from you, the elite. Example: #!/bin/sh counter=0 until (($counter>5)) counter2=1 until (($counter2>6)); do if ;... (5 Replies)
Discussion started by: TehOne
5 Replies

6. Shell Programming and Scripting

Creating Dynamic Variables from a Flat File

Greetings all, Been trying to do my Googling and forum searches but can't seem to lock in on a solution. I have a script that parses a log and collects all the uniq events to a flat file. Some days might have 50 unique events, other days might have 75. (Hence my reference to dynamic.) ... (2 Replies)
Discussion started by: sjrupp
2 Replies

7. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (1 Reply)
Discussion started by: vivek d r
1 Replies

8. Shell Programming and Scripting

'Dynamic' setting of variables in bash script

Hi all, I want to dynamically set variables in a bash script. I made a naive attempt in a while loop that hopefully can clarify the idea. n=0; echo "$lst" | while read p; do n=$(($n+1)); p"$n"="$p"; done The error message is: bash: p1=line1: command not found bash: p2=line2: command... (8 Replies)
Discussion started by: jeppe83
8 Replies

9. Shell Programming and Scripting

Generating dynamic variables

Hi , i am unable to generate dynamic variables can any one please help me on the below issue j=1 {record_count_"$j"}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i` echo " record... (3 Replies)
Discussion started by: bhaskar v
3 Replies

10. UNIX for Beginners Questions & Answers

[BASH] eval command not expanding variables as expected.

Hi Guys, I wrote a collection of bash functions years ago and now need to use them again but I'm getting some error messages when eval tries to expand the variables names. I recollect that I used the shopt command to set one of the options but I can't quite remember the command that I... (8 Replies)
Discussion started by: ASGR
8 Replies
PERFQUERY(8)							OpenIB Diagnostics						      PERFQUERY(8)

NAME
perfquery - query InfiniBand port counters SYNOPSIS
perfquery [-d(ebug)] [-G(uid)] [-e(xtended)] [-a(ll_ports)] [-l(oop_ports)] [-r(eset_after_read)] [-R(eset_only)] [-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] [-V(ersion)] [-h(elp)] [<lid|guid> [[port] [reset_mask]]] DESCRIPTION
perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and error counters) or PortExtendedCounters from the PMA at the node/port specified. Optionally shows aggregated counters for all ports of node. Also, optionally, reset after read, or only reset coun- ters. Note: In both PortCounters and PortCountersExtended, components that represent Data (e.g. PortXmitData and PortRcvData) indicate octets divided by 4 rather than just octets. Note: Inputting a port of 255 indicates an operation be performed on all ports. OPTIONS
-e, --extended show extended port counters rather than (basic) port counters. Note that extended port counters attribute is optional. -a, --all_ports show aggregated counters for all ports of the destination lid or reset all counters for all ports. If the destination lid does not support the AllPortSelect flag, all ports will be iterated through to emulate AllPortSelect behavior. -l, --loop_ports If all ports are selected by the user (either through the -a option or port 255) iterate through each port rather than doing than aggregate operation. -r, --reset_after_read reset counters after read -R, --Reset_only only reset counters COMMON OPTIONS
Most OpenIB diagnostics take the following common flags. The exact list of supported flags per utility can be found in the usage message and can be shown using the util_name -h syntax. # Debugging flags -d raise the IB debugging level. May be used several times (-ddd or -d -d -d). -e show send and receive errors (timeouts and others) -h show the usage message -v increase the application verbosity level. May be used several times (-vv or -v -v -v) -V show the version info. # Addressing flags -G use GUID address argument. In most cases, it is the Port GUID. Example: "0x08f1040023" -s <smlid> use 'smlid' as the target lid for SM/SA queries. # Other common flags: -C <ca_name> use the specified ca_name. -P <ca_port> use the specified ca_port. -t <timeout_ms> override the default timeout for the solicited mads. Multiple CA/Multiple Port Support When no IB device or port is specified, the port to use is selected by the following criteria: 1. the first port that is ACTIVE. 2. if not found, the first port that is UP (physical link up). If a port and/or CA name is specified, the user request is attempted to be fulfilled, and will fail if it is not possible. EXAMPLES
perfquery # read local port performance counters perfquery 32 1 # read performance counters from lid 32, port 1 perfquery -e 32 1 # read extended performance counters from lid 32, port 1 perfquery -a 32 # read perf counters from lid 32, all ports perfquery -r 32 1 # read performance counters and reset perfquery -e -r 32 1 # read extended performance counters and reset perfquery -R 0x20 1 # reset performance counters of port 1 only perfquery -e -R 0x20 1 # reset extended performance counters of port 1 only perfquery -R -a 32 # reset performance counters of all ports perfquery -R 32 2 0x0fff # reset only error counters of port 2 perfquery -R 32 2 0xf000 # reset only non-error counters of port 2 AUTHOR
Hal Rosenstock <halr@voltaire.com> OpenIB March 29, 2007 PERFQUERY(8)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy