Calling all experts:
When I ftp from Mainframe to unix server, the ftp message says fixed length 2060, but i lose trailing spaces.
I tried a solution i found here,
awk ' { printf("%-2060s\n",$0) } ' fname1 > fname2
works for small records but, err msg: string too long, for long records
... (1 Reply)
Hi guys,
i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
Greeting,
The following script completes after reading only one record from the input file that contains many records. I commented out the "ssh" and get what I expect, an echo of all the records in the input.txt file. Is ssh killing the file handle?
On the box "uname -a" gives "SunOS... (2 Replies)
friends,
I am running iostat command in linux. Following is the output
iostat -d
Linux 2.6.18-128.el5 (btovm725.ind.hp.com) 04/16/2010
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 21.49 5.32 255.61 2871221 138010414
sda1 ... (8 Replies)
Hi,
i want to replace comma by space for specified field in record, i mean i want to replace the commas in the 4th field by space. and rest all is same throught the record.
the record is
16458,99,001,"RIMOUSKI, QC",418,"N",7,EST,EDT,902
16458,99,002,"CHANDLER,... (5 Replies)
Hi,
I am reading file records inside a while loop,
and want to update the record when certain condition is met.
How can I update a file while being read?
I want to avoid using temporary files, copy, rename, ...
while IFS=',' read -r f1 f2
do
function(f1,f2)
if
then
<add... (1 Reply)
Hi ,
I want to remove space from each record in one file My file is like
BUD, BDL
ABC, DDD, ABC
ABC, DDD, DDD, KKK
The o/p should be
BUD,BDL
ABC,DDD,ABC
ABC,DDD,DDD,KKK
Can any one help me regarding this? (9 Replies)
I am trying to read a input file which has two columns separated by space
Input file
server1 server2
server3 server4
server5 server6
When i execute the below while code it reads line by line and a and b variables are able to successfully fetch the values
while read a b
do
echo "$a"
echo... (5 Replies)
Hi,
This query is a part of a much more lengthy script.
I wish to look for all the files in a folder named "data" which in this case has two files i.e. plan.war and agent.properties. For all the files found under data I wish to ask the user as to where they wish copy the files to.
Below,... (14 Replies)
Discussion started by: mohtashims
14 Replies
LEARN ABOUT SUNOS
times
times(2) System Calls times(2)NAME
times - get process and child process times
SYNOPSIS
#include <sys/times.h>
#include <limits.h>
clock_t times(struct tms *buffer);
DESCRIPTION
The times() function fills the tms structure pointed to by buffer with time-accounting information. The tms structure, defined in
<sys/times.h>, contains the following members:
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
All times are reported in clock ticks. The specific value for a clock tick is defined by the variable CLK_TCK, found in the header <lim-
its.h>.
The times of a terminated child process are included in the tms_cutime and tms_cstime members of the parent when wait(3C) or waitpid(3C)
returns the process ID of this terminated child. If a child process has not waited for its children, their times will not be included in
its times.
The tms_utime member is the CPU time used while executing instructions in the user space of the calling process.
The tms_stime member is the CPU time used by the system on behalf of the calling process.
The tms_cutime member is the sum of the tms_utime and the tms_cutime of the child processes.
The tms_cstime member is the sum of the tms_stime and the tms_cstime of the child processes.
RETURN VALUES
Upon successful completion, times() returns the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, sys-
tem start-up time). This point does not change from one invocation of times() within the process to another. The return value may overflow
the possible range of type clock_t. If times() fails, (clock_t)-1 is returned and errno is set to indicate the error.
ERRORS
The times() function will fail if:
EFAULT The buffer argument points to an illegal address.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO time(1), timex(1), exec(2), fork(2), time(2), waitid(2), wait(3C), waitpid(3C), attributes(5), standards(5)SunOS 5.10 14 May 1997 times(2)