Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk to capture memory difference Post 303039965 by RudiC on Saturday 19th of October 2019 10:10:57 AM
Old 10-19-2019
Try posting runnable, syntax error free code only so people can concentrate on the logical problems. I won't comment on the obvious errors in your incomplete code snippet above. How about
Code:
awk '
/show memory compare start/     {getline
                                 start_time = $0;
                                }
/show memory compare end/       {getline
                                 end_time = $0;
                                }

start_time &&
end_time   &&
/mibd_interface/                {print start_time, $3, end_time, $4
                                 start_time = end_time = ""
                                }
' OFS="\t" file
Thu Sep 19 14:38:06.400 WIB    8670334    Thu Sep 19 14:40:56.123 WIB    8484152
Thu Sep 19 14:43:07.946 WIB    8369050    Thu Sep 19 14:45:27.916 WIB    8514825

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

relationship or difference between entitled memory and locked memory

Hello solaris experts, Being new to solaris containers, from Linux, feeling difficulty in understanding certain concepts. Hope somebody can help me here. I understand that, & some questions .... Locked memory -- memory which will not be swapped out at any cause. is this for... (0 Replies)
Discussion started by: thegeek
0 Replies

2. Shell Programming and Scripting

gsub in Awk to capture count of replaced characters

Hi , I am working on a script to replace special characters in ASCII file with '?'. We need to get count of replaced characters from file. I am new to Awk and i read, # The gsub function returns the number of substitutions made. I was trying to replace characters with below... (10 Replies)
Discussion started by: Akshay
10 Replies

3. Shell Programming and Scripting

AWK Script to Capture Each Line of File As Variable

Hi All, I'm working on creating a parts database. I currently have access to a manufacturer database in HTML and am working on moving all of the data into a MySQL db. I have created a sed script that strips out the HTML and unnecessary info and separates the script into one line for each field.... (3 Replies)
Discussion started by: dkr
3 Replies

4. Shell Programming and Scripting

awk help string capture

Dear All My input file as under. From it I want op fine as mention below. Kindly help. I use below code but not help. code: awk -F" " '{print $2}' ip file: "BSCJNGR_IPA17_C" 030 131207 1305 RXOCF-353 PBD011_BGIL BOTH AC FAULTY "BSCJNGR_IPA17_C" 991 131207 1637 RXOCF-224 NAV001_BGIL ... (5 Replies)
Discussion started by: jaydeep_sadaria
5 Replies

5. Shell Programming and Scripting

Awk:String search more than one time and capture OP

Dear All During one of mine script developemnt i am stuch at one sub part. Requiremnt is as below kindly help me. IP file: 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001X (unavailable) 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001Y (unavailable) 2015-02-28 10:10:15 AL M... (6 Replies)
Discussion started by: jaydeep_sadaria
6 Replies

6. UNIX for Dummies Questions & Answers

What is the difference in this two awk command?

What is the difference in these two awk command? Both returns same output but I am not sure what is the use of +0 in command 1. awk -F "," '{print $1+0,$2+0,$3+0}' awk -F "," '{print $1, $2, $3}' (3 Replies)
Discussion started by: later_troy
3 Replies

7. Shell Programming and Scripting

awk to capture lines that meet either condition

I am trying to modify and understand an awk written by @Scrutinizer The below awk will filter a list of 30,000 lines in the tab-delimited file. What I am having trouble with is adding a condition to SVTYPE=CNV that will only print that line if CI=,0.95: portion in blue in file is <1.9. The... (2 Replies)
Discussion started by: cmccabe
2 Replies

8. Shell Programming and Scripting

Awk: What is the difference between: X[a,b,c] - X[a][b,c] - X[a][b][c]

I have awk appearing to behave inconsistently. With the same variable it will give the message: fatal: attempt to use array `X' in a scalar context and, if I try to correct that, then: fatal: attempt to use a scalar value as array I'm using a three dimensional array. There seems to be a... (2 Replies)
Discussion started by: Fustbariclation
2 Replies

9. Shell Programming and Scripting

Difference in awk output and while

so, im going over one of my scripts and trying to optimize it. i have a code like this: cksum sjreas.py | awk '{prinnt $1$2}' This does what I need. However, i dont want to call the external command awk. so im doing this: cksum sjreas.py | while OFS=' ' read v1 v2 ; do printf... (4 Replies)
Discussion started by: SkySmart
4 Replies

10. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies
FS_USAGE(1)						    BSD General Commands Manual 					       FS_USAGE(1)

NAME
fs_usage -- report system calls and page faults related to filesystem activity in real-time SYNOPSIS
fs_usage [-e] [-w] [-f mode] [-b] [-t seconds] [-R rawfile [-S start_time] [-E end_time]] [pid | cmd [pid | cmd] ...] DESCRIPTION
The fs_usage utility presents an ongoing display of system call usage information pertaining to filesystem activity. It requires root privi- leges due to the kernel tracing facility it uses to operate. By default, the activity monitored includes all system processes except the running fs_usage process, Terminal, telnetd, telnet, sshd, rlogind, tcsh, csh, sh, and zsh. These defaults can be overridden such that out- put is limited to include or exclude a list of processes specified by the user. The output presented by fs_usage is formatted according to the size of your window. A narrow window will display fewer columns of data. Use a wide window for maximum data display. You may override the window formatting restrictions by forcing a wide display with the -w option. In this case, the data displayed will wrap when the window is not wide enough. The options are as follows: -e Specifying the -e option generates output that excludes sampling of the running fs_usage tool. If a list of process IDs or commands is also given, then those processes are also excluded from the sampled output. -w Specifying the -w option forces a wider, more detailed output, regardless of the window size. -f Specifying the -f option turns on output filtering based on the mode provided. Multiple filtering options can be specified. By default, no output filtering occurs. The supported modes are: network Network-related events are displayed. filesys Filesystem-related events are displayed. pathname Pathname-related events are displayed. exec Exec and spawn events are displayed. diskio Disk I/O events are displayed. cachehit In addition, show cache hits. -b Specifying the -b option annotates disk I/O events with BootCache info (if available). -t seconds Specifies a run timeout in seconds. fs_usage will run for no longer than the timeout specified. -R raw_file Specifies a raw trace file to process. -S start_time If -R is selected, specifies the start time in microseconds to begin processing entries from the raw trace file. Entries with time- stamps before the specified start time will be skipped. -E end_time If -R is selected, specifies the ending time in microseconds to stop processing entries from the raw trace file. Entries with time- stamps beyond the specified ending time will be skipped. pid | cmd The sampled data can be limited to a list of process IDs or commands. When a command name is given, all processes with that name will be sampled. Using the -e option has the opposite effect, excluding sampled data relating to the given list of process IDs or commands. The data columns displayed are as follows: TIMESTAMP TOD when call occurred. Wide mode will have microsecond granularity. CALL The name of the network or filesystem related call, page-in, page-out, or physical disk access. FILE DESCRIPTOR Of the form F=x, x is a file descriptor. Depending on the type of system call, this will be either an input value or a return value. BYTE COUNT Of the form B=x, x is the number of bytes requested by the call. [ERRNO] On error, the errno is displayed in brackets. PATHNAME Pathname of the file accessed (up to the last 28 bytes). FAULT ADDRESS Of the form A=0xnnnnnnnn, where 0xnnnnnnnn is the address being faulted. DISK BLOCK NUMBER Of the form D=0xnnnnnnnn, where 0xnnnnnnnn is the block number of the physical disk block being read or written. OFFSET Of the form O=0xnnnnnnnn, where 0xnnnnnnnn is a file offset. SELECT RETURN Of the form S=x, x is the number of ready descriptors returned by the select() system call. If S=0, the time limit expired. TIME INTERVAL(W) The elapsed time spent in the system call. A 'W' after the elapsed time indicates the process was scheduled out during this file activity. In this case, the elapsed time includes the wait time. PROCESS NAME The process that made the system call. Wide mode will append the thread id to the process name (i.e Mail.nnn). SAMPLE USAGE
fs_usage -w -f filesys Mail fs_usage will display file system related data for all instances of processes named Mail. Maximum data output will be displayed in the win- dow. SEE ALSO
dyld(1), latency(1), sc_usage(1), top(1) Mac OS X November 7, 2002 Mac OS X
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy