I have 2 files f1 and f2. when i use nawk to compare the difference(subtraction) from 4th column of the file, it truncates the output.
can you please help to resolve this.
subtraction is (4th col of f1 - 4th col of f2). but it gives only below lines out of 116. I want to print all the lines of the file even if there is diff or no diff.
I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Hello friends,
I doing the follwing script , but found problem to store it to a shell variable.
#! /bin/sh
for temp in `find ./dat/vector/ -name '*.file'`
do
echo $temp
nawk -v temp=$temp 'BEGIN{ split(temp, a,"\/"); print a}'
done
output:
./dat/vector/drf_all_002.file... (6 Replies)
I have a variable that is a full path name and I just want the file name with out the extension. I have figured out how to do this using some temp files but I would really like to avoid that if possible.
I know I can do
echo ${TMPNAME%.*} to drop the extension is there a similar way to drop... (3 Replies)
Hi all
i have 2 input files
1st file is
N1 | N2|N3|N4|N5|N6|N7|N8|N9
4041491000|245160|1|0|0|1|0|0|0
4041401505|152178|1|1|1|1|0|0|0
4041450004|014052|1|1|1|1|0|0|0
4041450005|580916|1|1|1|1|0|0|0
4041491000|230990|1|0|1|1|0|0|0
4041460001|338317|1|1|1|1|0|0|0
2nd file
N1 |... (8 Replies)
I have searched and the answers I have found thus far have led me to this point, so I feel I am just about there.
I am trying to convert a column of hexadecimal to decimal values so that I can filter out via grep just the data I want. I was able to pull my original 3 character hex value and... (10 Replies)
Hi All,
I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file.
Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file.
script :... (3 Replies)
Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare
nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Hi
I have this command, which counts number of lines in a specific file and then prints it on screen.nawk 'NF{c++}END{print "Number of GPS coordinates in file: "c}' $filename
I would like to have the output put into a variable, but can't seem to find the correct argument for it.
How do I... (3 Replies)
Hello,
I'm writing an Awk script to take a command line argument (student's name) and output their relevant student#, name, and marks. For some reason, awk arbitrarily removes the first digit from the student number and doesn't show me the proper output.
Here is my code:
#! /usr/bin/awk -f... (6 Replies)
Hello,
This is Solaris 10 (x86)
bash-3.2# cat /etc/release
Solaris 10 5/09 s10x_u7wos_08 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 30 March... (5 Replies)
Discussion started by: solaris_1977
5 Replies
LEARN ABOUT OSF1
times
times(3) Library Functions Manual times(3)NAME
times - Gets process and child process times
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <sys/times.h>
clock_t times(
struct tms *buffer);
Programs that are being developed for conformance to the AT&T System V Interface Definition must specify two #include statements, as fol-
lows:
#include <sys/types.h> #include <sys/times.h>
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
times(): XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to type tms structure space where system time information is stored.
DESCRIPTION
The times() function fills the type tms structure space pointed to by the buffer parameter with time-accounting information. All time val-
ues reported by this function are in hardware-dependent clock ticks.
The times of a terminated child process are included in the tms_cutime and tms_cstime elements of the parent process when a wait function
returns the process ID of that terminated child.
The tms structure, which is defined in the sys/times.h header file, contains the following members: User time. The CPU time charged while
executing user instructions of the calling process. System time. The CPU time charged during system execution on behalf of the calling
process. User time, children. The sum of the tms_utime and the tms_cutime times of the child processes. System time, children. The sum of
the tms_stime and the tms_cstime times of the child processes.
When a child process does not wait for its children, its child-process times are not included in its times.
This information comes from the calling process and each of its terminated child processes for which a wait function has been executed.
RETURN VALUES
Upon successful completion, the times() function returns the elapsed real time since an arbitrary reference time in the past (for example,
system start-up time). The reference time does not change from one invocation of times() within the process to another. The elapsed times
are in units of 1/CLK_TCK seconds, where CLK_TCK is processor dependent. For application portability, the value of CLK_TCK should be
queried using the sysconf() function (see sysconf(3)).
The return value may overflow the possible range of type clock_t values. When the times() function fails, a value of (clock_t)-1 is
returned.
RELATED INFORMATION
Commands: cc(1)
Functions: exec(2), fork(2), getrusage(2), profil(2), stime(3), sysconf(3), time(3), wait(2)
Standards: standards(5) delim off
times(3)