05-14-2017
Thank you RudiC and MadeInGermany. That works. Just wanted to know that during reading $2 is 0e123456789 but why does awk interpret $2 to 0 i.e., process $2 as scientific notation during ! $2 in earlier code. Can you please explain this behavior. Is this again specific to Linux as this was executing without issues in AIX. Thank you for your time.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi , Migrating AIX 4.3.3 ML10 to 5.3 ML1 (retaining 32 bit)
after successfully going through 5 of the 5.3 Install CD's. After "All fileset's processed successfully " message I was told that system would reboot and then I would get prompted for setting TERm type ( i have an ascii ibm3151) and... (1 Reply)
Discussion started by: Student37
1 Replies
2. Shell Programming and Scripting
Hi,
two teams at two locations - A & B. At location A, we have AIX 5.3 and at location B, we have AIX 5.1. We execute the below awk command in loc A and it executes successfully(part of a larger script). But the same does not get executed in the loc B server.
We are not able to access the loc B... (1 Reply)
Discussion started by: ranj@chn
1 Replies
3. AIX
Hello All,
We want to upgrade our 44p Model 270 from AIX 5.2 to 5.3. This is a standalone devlopment server but downtime is something we don't want because we have a short development deadline looming. I have no tape drive to make backups to. I myself am a developer and don't have any... (4 Replies)
Discussion started by: Fred Vogel
4 Replies
4. AIX
Hi,
redbook documentation is telling that IY17981 fix is required for aix 4.3.3 to aix 5L migration. But there is no mention about that fix in any ML installation packages.
- My system is ML11 :
oslevel –r
4330-11
- But xlC.rte is on wrong version :
lslpp -L xlC.rte
xlC.rte ... (3 Replies)
Discussion started by: astjen
3 Replies
5. Shell Programming and Scripting
Is there a way to treat a string as date and compare it to the current date?
lets assum inpu lik
$ cat myfile
Name Last login
**************************
Sara 2/13/2012
kalpeer 2/15/2012
ygemici 2/14/2012
we want to display the name who logged in during the last #... (4 Replies)
Discussion started by: Sara_84
4 Replies
6. Shell Programming and Scripting
Hi all,
For no particular reason, I would like to use awk on a file that contains multiple columns, but let's say only columns 1 and 2 have some text values, and the remainder of the line contains text that I would like to treat as one column, considering I have spaces as delimiter for the... (33 Replies)
Discussion started by: ppucci
33 Replies
7. Shell Programming and Scripting
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies
8. AIX
I'm New to AIX / VIOS
We're doing a FC switch cutover on an ibm device, connected via SAN.
How do I tell if one path to my remote disk is lost? (aix lvm)
How do I tell when my link is down on my HBA port?
Appreciate your help, very much! (4 Replies)
Discussion started by: BG_JrAdmin
4 Replies
9. AIX
Hi Experts , I want to start migrating our AIX 6.1 to AIX 7.1 . I am planning to use alt_disk_migration . Chris gibson has awesome documentation in the internet. However I am running into an issue with EMC odm filesets . So my current OS is AIX 6.1. and I have this :
lslpp -l | grep EMC
... (7 Replies)
Discussion started by: JME2015
7 Replies
10. Shell Programming and Scripting
Hi, awk seem to be acting differently in Unix and Linux when it comes to formatting. This is making it difficult to migrate scripts.
for example:
UNIX:
echo "123" |awk '{printf ("%05s\n" ,$1)}'
00123
echo "123" |awk '{printf ("%05d\n" ,$1)}'
00123
echo "S12" |awk '{printf ("%05s\n"... (9 Replies)
Discussion started by: wanderingmind16
9 Replies
TIMES(2) Linux Programmer's Manual TIMES(2)
NAME
times - get process times
SYNOPSIS
#include <sys/times.h>
clock_t times(struct tms *buf);
DESCRIPTION
times() stores the current process times in the struct tms that buf points to. The struct tms is as defined in <sys/times.h>:
struct tms {
clock_t tms_utime; /* user time */
clock_t tms_stime; /* system time */
clock_t tms_cutime; /* user time of children */
clock_t tms_cstime; /* system time of children */
};
The tms_utime field contains the CPU time spent executing instructions of the calling process. The tms_stime field contains the CPU time
spent in the system while executing tasks on behalf of the calling process. The tms_cutime field contains the sum of the tms_utime and
tms_cutime values for all waited-for terminated children. The tms_cstime field contains the sum of the tms_stime and tms_cstime values for
all waited-for terminated children.
Times for terminated children (and their descendants) are added in at the moment wait(2) or waitpid(2) returns their process ID. In par-
ticular, times of grandchildren that the children did not wait for are never seen.
All times reported are in clock ticks.
RETURN VALUE
times() returns the number of clock ticks that have elapsed since an arbitrary point in the past. The return value may overflow the possi-
ble range of type clock_t. On error, (clock_t) -1 is returned, and errno is set appropriately.
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
NOTES
The number of clock ticks per second can be obtained using:
sysconf(_SC_CLK_TCK);
In POSIX.1-1996 the symbol CLK_TCK (defined in <time.h>) is mentioned as obsolescent. It is obsolete now.
In Linux kernel versions before 2.6.9, if the disposition of SIGCHLD is set to SIG_IGN then the times of terminated children are automati-
cally included in the tms_cstime and tms_cutime fields, although POSIX.1-2001 says that this should only happen if the calling process
wait(2)s on its children. This nonconformance is rectified in Linux 2.6.9 and later.
On Linux, the buf argument can be specified as NULL, with the result that times() just returns a function result. However, POSIX does not
specify this behavior, and most other Unix implementations require a non-NULL value for buf.
Note that clock(3) also returns a value of type clock_t, but this value is measured in units of CLOCKS_PER_SEC, not the clock ticks used by
times().
On Linux, the "arbitrary point in the past" from which the return value of times() is measured has varied across kernel versions. On Linux
2.4 and earlier this point is the moment the system was booted. Since Linux 2.6, this point is (2^32/HZ) - 300 (i.e., about 429 million)
seconds before system boot time. This variability across kernel versions (and across Unix implementations), combined with the fact that
the returned value may overflow the range of clock_t, means that a portable application would be wise to avoid using this value. To mea-
sure changes in elapsed time, use gettimeofday(2) instead.
Historical
SVr1-3 returns long and the struct members are of type time_t although they store clock ticks, not seconds since the Epoch. V7 used long
for the struct members, because it had no type time_t yet.
BUGS
A limitation of the Linux system call conventions on some architectures (notably i386) means that on Linux 2.6 there is a small time window
(41 seconds) soon after boot when times() can return -1, falsely indicating that an error occurred. The same problem can occur when the
return value wraps passed the maximum value that can be stored in clockid_t.
SEE ALSO
time(1), getrusage(2), wait(2), clock(3), sysconf(3), time(7)
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-06-25 TIMES(2)