I get this output:
As you see, all output lines end with 194 which is a number. I need a pipeline command (attached to the original command above) to get all these numbers, add them up and store them in a variable called TOTAL. so in this case TOTAL should contain 194*10 or 1940
Does anyone know how to do this??
Any sugestions will be highly appreciated
omoyne
Last edited by Scott; 05-17-2010 at 02:50 PM..
Reason: Code tags, please...
Hi all!
I have two files containing one field each.
The fields consist of numbers separated in records e.g.
file1.dat
1657
2345
5678
5676
7978
7856
5686
5676
8990
.
.
. (2 Replies)
Hi,
I have a huge text file. It looks like
abcde bangalo country 12345 lastfield
i want to get first 3 characters from field1 and first 3 characters from field 2 and insert the result as a new field. example the result should be:
abcde bangalo abcban country 12345 lastfield
Please... (4 Replies)
I have a large flat file with variable length fields that are pipe delimited. The file has no new line or CR/LF characters to indicate a new record. I need to parse the file and after some number of fields, I need to insert a CR/LF to start the next record.
Input file ... (2 Replies)
Hi,
I want to add two fields with values '1000' and 'XYZ-1234' at the end of every line in a comma delimited file.
Should I use any command in a loop to add the fields or using any single command Shall I acheive it?
Kindly help me in code.
Thanks,
Poova. (6 Replies)
Hi everybody (first time posting here)
I have a file1 that looks like >
1,101,0.1,0.1
1,26,0.1,0.1
1,3,0.1,0.1
1,97,0.5,0.5
1,98,8.1,0.218919
1,99,6.2,0.248
2,101,0.1,0.1
2,24,3.1,0.147619
2,25,23.5,0.559524
2,26,34,0.723404with 762 lines..
I have another 'similar' file2 >
... (10 Replies)
I have tab delimited input that prints out in the format below:
I am trying to add field headers to $5 and $6. Not sure if sed is the best tool but my attempt is below. Thank you :).
$5 = REF
$6 = ALT
file
ID CHR START STOP
123 1 100 200 A ... (6 Replies)
In the tab-delimited input below I am trying to use awk to -10 from $2 and +10 to $3. Something like
awk -F'\t' -v OFS='\t' -v s=10 '{split($4,a,":"); print $1,$2-s,$3+s,a,$5,$6} | awk {split(a,b,"-"); print $1,$2-s,$3+s,b-s,b+s,$5,$6}' input
should do that. I also need to -10 from $4... (2 Replies)
hi,
would you help me?
i have file total.csv
"name","id","gender"
"a,"e23","f"
"b,"34d","g"
"c","45f","f"
"d","45s","f"
and file count.csv
3
i want to add file count to file total every row
name,id,gender,total_match
"a,"e23","f","3"
"b,"34d","g","3"
"c","45f","f","3"
... (4 Replies)
So, I have three problems that cover this subject.
First one asks me to find the number of fields in the file that contain the substring "he". I found the number of fields, but the problem I have is that they are displaying by each record. I want to add all of the records' fields together.
With... (2 Replies)
Discussion started by: mc10
2 Replies
LEARN ABOUT OSX
snmpwalk
SNMPWALK(1) Net-SNMP SNMPWALK(1)NAME
snmpwalk - retrieve a subtree of management values using SNMP GETNEXT requests
SYNOPSIS
snmpwalk [APPLICATION OPTIONS] [COMMON OPTIONS] [OID]
DESCRIPTION
snmpwalk is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree of information.
An object identifier (OID) may be given on the command line. This OID specifies which portion of the object identifier space will be
searched using GETNEXT requests. All variables in the subtree below the given OID are queried and their values presented to the user.
Each variable name is given in the format specified in variables(5).
If no OID argument is present, snmpwalk will search the subtree rooted at SNMPv2-SMI::mib-2 (including any MIB object values from other MIB
modules, that are defined as lying within this subtree). If the network entity has an error processing the request packet, an error packet
will be returned and a message will be shown, helping to pinpoint why the request was malformed.
If the tree search causes attempts to search beyond the end of the MIB, the message "End of MIB" will be displayed.
OPTIONS -Cc Do not check whether the returned OIDs are increasing. Some agents (LaserJets are an example) return OIDs out of order, but can
complete the walk anyway. Other agents return OIDs that are out of order and can cause snmpwalk to loop indefinitely. By default,
snmpwalk tries to detect this behavior and warns you when it hits an agent acting illegally. Use -Cc to turn off this check.
-CE {OID}
End the walk at the specified OID, rather than a simple subtree. This can be used to walk a partial subtree, selected columns of a
table, or even two or more tables within a single command.
-Ci Include the given OID in the search range. Normally snmpwalk uses GETNEXT requests starting with the OID you specified and returns
all results in the MIB subtree rooted at that OID. Sometimes, you may wish to include the OID specified on the command line in the
printed results if it is a valid OID in the tree itself. This option lets you do this explicitly.
-CI In fact, the given OID will be retrieved automatically if the main subtree walk returns no useable values. This allows a walk of a
single instance to behave as generally expected, and return the specified instance value. This option turns off this final GET
request, so a walk of a single instance will return nothing.
-Cp Upon completion of the walk, print the number of variables found.
-Ct Upon completion of the walk, print the total wall-clock time it took to collect the data (in seconds). Note that the timer is
started just before the beginning of the data request series and stopped just after it finishes. Most importantly, this means that
it does not include snmp library initialization, shutdown, argument processing, and any other overhead.
In addition to these options, snmpwalk takes the common options described in the snmpcmd(1) manual page.
EXAMPLES
The command:
snmpwalk -Os -c public -v 1 zeus system
will retrieve all of the variables under system:
sysDescr.0 = STRING: "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
sysObjectID.0 = OID: enterprises.hp.nm.hpsystem.10.1.1
sysUpTime.0 = Timeticks: (155274552) 17 days, 23:19:05
sysContact.0 = STRING: ""
sysName.0 = STRING: "zeus.net.cmu.edu"
sysLocation.0 = STRING: ""
sysServices.0 = INTEGER: 72
(plus the contents of the sysORTable).
The command:
snmpwalk -Os -c public -v 1 -CE sysORTable zeus system
will retrieve the scalar values, but omit the sysORTable.
SEE ALSO snmpcmd(1), snmpbulkwalk(1), variables(5).
V5.6 28 May 2007 SNMPWALK(1)