I have a file which contains data as below:
-----------------------------------------------------------------------------------------------
GSPWeb Statistics for the period of last 20 days... (3 Replies)
Friends,
I have to run iostat -d on my AIX machine and print the sum of the output in tps column per iteration. can any one pls guide me how to do this using awk. here is the sample output
iostat -d 2 2 | awk '!/System/ && !/Disks/ && !/cd/ && !/^$/ {print $4}'
2.0
3.0
1.0
3.0... (1 Reply)
Basically I have to process a text file which has been sorted this way:
John 12
John 13
John 10
John 900
Peter 20
Peter 30
Peter 32
The first column is a name, and the second an arbitrary value, both delimited by a space. How can I sum them up such that it would become:
John 935... (2 Replies)
I have results from some statistical analyses.
The format of the results are as given below:
I want to select lines that have a p-value (last column) less than 0.05 from all the results files (*.results) and cat to a new results file.
It would be very nice if a new column is added that tells... (2 Replies)
I need help reading and summing some values in a file that looks like the following. This is an Oracle trace file. Oracle has as utility to do this,but it doesn't work properly unless my sql statement is done. I want to read the file and sum up some values to let me know how the query/job is... (0 Replies)
data file contains
failed=24
error=23
error=163
failed=36
error=903
i need to get a total count of each value above. i'm looking for the most efficient method to do this as the datafile i provided is just a sample. the actual data can be several hundred thousands of lines.
so from... (3 Replies)
I want to sum and average all other columns by first column
GR1 1 4 7
GR1 2 5 8
GR1 3 6 9
GR2 11 14 17
GR2 13 16 19
GR3 1 3 5
GR3 2 4 6
For a limited number of columns I can do... (2 Replies)
I have a large XML file that I want to parse, and only print one specific value if two values are met.
This is the code so far:
#!/usr/local/bin/python
import xml.etree.ElementTree as ET
tree = ET.parse('onedb-dhcp.xml')
root = tree.getroot()
# This successfully gets all... (1 Reply)
I have two directories of files (new-config-files and old-config-files):
new-config-files/this-db/config.inc.php
new-config-files/that-db/config.inc.php
new-config-files/old-db/config.inc.php
new-config-files/new-db/config.inc.php
new-config-files/random-database/config.inc.php
etc.
... (4 Replies)
Discussion started by: spacegoose
4 Replies
LEARN ABOUT OPENSOLARIS
elfwrap
elfwrap(1) User Commands elfwrap(1)NAME
elfwrap - wrap data in an ELF file
SYNOPSIS
elfwrap [-64] [-o relobj-file] [-z target=sparc | x86]
data-file...
DESCRIPTION
The elfwrap utility creates an ELF relocatable object file from one or more data files. The relocatable object encapsulates each data file
within an individual section, together with symbols that can be used to reference the section. The relocatable object is appropriate for
inclusion with a subsequent link-edit. Users can reference the encapsulated data using the associated symbols.
By default, a 32-bit ELF relocatable object is created that is appropriate for the machine on which elfwrap is executed. The -64 option can
be used to create a 64-bit ELF relocatable object. The -z target option can be used to create a relocatable object for a specific machine
type.
Note -
Any data encapsulated with elfwrap must be in a format appropriate for the destination target.
By default, the relocatable object a.wrap.o is created. The -o option can be used to specify an alternative relocatable object name.
The basename(1) of each data file is used to create various pieces of ELF information. For example, if the input data file is ISV/isv-
data, the following ELF information is created within the relocatable object.
An ELF section named .isv-data
This section contains the entire contents of the input data file.
An ELF symbol named isv-data_start
This symbol reflects the starting address of the .isv-data section.
An ELF symbol named isv-data_end
This symbol reflects the address of the first location after the .isv-data section.
OPTIONS
The following options are supported:
-64
Create a 64-bit ELF relocatable object.
-o relobj-file
Produce a relocatable object that is named relobj-file.
-z target=sparc | x86
Specifies the machine type for the output relocatable object. Supported targets are sparc and x86. The 32-bit machine type for the
specified target is used unless the -64 option is also present, in which case the corresponding 64-bit machine type is used. By
default, the relocatable object that is generated is 32-bit for the machine one which elfwrap is executed.
EXAMPLES
The following example encapsulates the system passwd file and the system group file within a relocatable object passgroup.o.
example% elfwrap -o passgroup.o /etc/passwd /etc/group
example% elfdump -s passgroup.o | egrep "passwd|group"
[2] 0x00000000 0x00000000 SECT LOCL D 0 .passwd
[3] 0x00000000 0x00000000 SECT LOCL D 0 .group
[7] 0x00000000 0x000002f0 OBJT GLOB D 0 .passwd passwd_start
[8] 0x000002f0 0x00000000 OBJT GLOB D 0 .passwd passwd_end
[9] 0x00000000 0x00000121 OBJT GLOB D 0 .group group_start
[10] 0x00000121 0x00000000 OBJT GLOB D 0 .group group_end
example% strings -N.passwd passgroup.o | head -1
root:x:0:0:Super-User:/:/sbin/sh
example% strings -N.group passgroup.o | head -1
root::0:
This relocatable object can be referenced from the following user code.
example% cat main.c
#include <stdio.h>
extern char passwd_start, passwd_end;
void main()
{
char *pstart = &passwd_start, *pend = &passwd_end;
char *str, *lstr;
for (lstr = str = pstart; str < pend; str++) {
if ((*str == '0) && (str != (pend - 1))) {
(void) printf("%.*s", (++str - lstr), lstr);
lstr = str;
}
}
}
example% cc -o main main.c passgroup.o
example% ./main
root:x:0:0:Super-User:/:/sbin/sh
....
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
FILES
a.wrap.o The default relocatable object file created.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWtoo |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
SEE ALSO elfdump(1), ld(1), strings(1), elf(3ELF), attributes(5), ddi_modopen(9F)
Linker and Libraries Guide
SunOS 5.11 17 March 2008 elfwrap(1)