Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script shell calculate mean arrival request duration Post 302850467 by Smiling Dragon on Wednesday 4th of September 2013 10:44:12 PM
Old 09-04-2013
To assist us in this, try breaking the problem up a bit - I can't spek fo the others here but I'm reluctant to expend a bunch of energy understanding how that packet dump format works and what the chain of events should be.

What specific questions do you have?
Are you having trouble making a script that identifies which lines in the output make up one 'conversation'? (If so, list what one conversation would look like and then show it in the larger output)
Are you having trouble scripting the maths to calculate the time differences? (If so, show exactly what values you are trying to perform the maths on).

Sorry I can't help more yet but you should find plenty of assistance once the problem is more clear.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script calculate the hits ?!

could you please find a solution for this a complex command using pipes to Calculate the number of hits per client in Squid log file (access.log), the command should display most active hosts first. Line example 1197979501.787 1 10.1.14.62 TCP_NEGATIVE_HIT/404 1463 GET http://url The... (0 Replies)
Discussion started by: anything
0 Replies

2. Shell Programming and Scripting

need to invoke a script upon arrival of a file

hi all, i recieve a file from other server, on a daily basis .... but the time of arrival is unpredictable .... i need to move this file to another directory before the next file arrives ... i have written a script that does this op and performs some manipulations on the data... but i... (2 Replies)
Discussion started by: sais
2 Replies

3. Shell Programming and Scripting

Calling a request set from Unix shell Script

Hi All, I want to call a concurrent request set from a shell script. I am getting the syntax error "syntax error at line 417 : `(' unexpected" in the below script. v_request_id=fnd_request.submit_request(application => 'APPL_SHORT_NAME' ,program => 'PROGRAM_SHORT_NAME' ... (4 Replies)
Discussion started by: swatipevekar
4 Replies

4. Shell Programming and Scripting

shell script to get the arrival count of file

Hello All, I have come across a small problem. It would be great if any of you could help me in resolving the issue. one file named dummy.txt will be ftped to Unix machine twice daily. If i receive it second time in a day i need to do some processing with the file. How to find the... (2 Replies)
Discussion started by: RSC1985
2 Replies

5. Shell Programming and Scripting

date duration fail to calculate

Hi Everyone, I was very sad after a long way but still cannot figure out the duration between two date. $date1="20090812 23:48:56"; $date2="20090813 00:01:37"; The output will be "001241". I did the following tries, like print localtime(UnixDate(ParseDate("20090812 23:48:56"),"%s"));... (2 Replies)
Discussion started by: jimmy_y
2 Replies

6. Shell Programming and Scripting

Calculate Date from shell script

I have a txt file which now has the following output Sat Mar 6 04:00:01 Sat Mar 6 04:02:09 processing 585 Sat Mar 6 17:00:01 Sat Mar 6 17:00:58 processing 109 Sun Mar 7 04:00:01 Sun Mar 7 04:00:51 processing 309 Sun Mar 7 17:00:01 Sun Mar 7 17:00:41 processing 48 I want output as... (1 Reply)
Discussion started by: gubbu
1 Replies

7. Shell Programming and Scripting

Shell script request

I've a master file which will contain 100 file names, The script should read file name from a master file and format the file as below in AIX. input file Filename This is a test file Output File Filename|This is a test file Thanks in advance for file in $FileList; do (5 Replies)
Discussion started by: udayakumar
5 Replies

8. Shell Programming and Scripting

Convert Date from File and Calculate Duration

Hi - I am looking for a little help to read in 2 date fields from a file in format: 20120508134012.3 yyyymmddhhmmss.tenths of a second So i want to: 1. Read in the 1st date from the file 2. Read in the second date from the file 3. Calculate the difference in minutes (or seconds) 4. ... (5 Replies)
Discussion started by: Newbie2012
5 Replies

9. Shell Programming and Scripting

Shell script to calculate the max cpu usage from the main script

Hi All, I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide which cpu number (column 2) has maximum value (column 6). Since the output is displayed/updated every seconds, it's very... (1 Reply)
Discussion started by: Optimus81
1 Replies

10. UNIX for Beginners Questions & Answers

How to calculate time duration in Linux?

I want to calculate duration for below file in this format SID | Date | Starttime |Date |End time 1607 |2019-04-05|13:06:42|2019-04-05|13:07:12 2327 |2019-04-05|13:57:26|2019-04-05|13:57:43 O/p should be like this: SID | Date | Starttime |Date |Endtime... (4 Replies)
Discussion started by: anupmishra
4 Replies
DIFF(1) 							     GNU Tools								   DIFF(1)

NAME
diff - find differences between two files SYNOPSIS
diff [options] from-file to-file DESCRIPTION
In the simplest case, diff compares the contents of the two files from-file and to-file. A file name of - stands for text read from the standard input. As a special case, diff - - compares a copy of standard input to itself. If from-file is a directory and to-file is not, diff compares the file in from-file whose file name is that of to-file, and vice versa. The non-directory file must not be -. If both from-file and to-file are directories, diff compares corresponding files in both directories, in alphabetical order; this compari- son is not recursive unless the -r or --recursive option is given. diff never compares the actual contents of a directory as if it were a file. The file that is fully specified may not be standard input, because standard input is nameless and the notion of ``file with the same name'' does not apply. diff options begin with -, so normally from-file and to-file may not begin with -. However, -- as an argument by itself treats the remain- ing arguments as file names even if they begin with -. Options Below is a summary of all of the options that GNU diff accepts. Most options have two equivalent names, one of which is a single letter preceded by -, and the other of which is a long name preceded by --. Multiple single letter options (unless they take an argument) can be combined into a single command line word: -ac is equivalent to -a -c. Long named options can be abbreviated to any unique prefix of their name. Brackets ([ and ]) indicate that an option takes an optional argument. -lines Show lines (an integer) lines of context. This option does not specify an output format by itself; it has no effect unless it is combined with -c or -u. This option is obsolete. For proper operation, patch typically needs at least two lines of context. -a Treat all files as text and compare them line-by-line, even if they do not seem to be text. -b Ignore changes in amount of white space. -B Ignore changes that just insert or delete blank lines. --brief Report only whether the files differ, not the details of the differences. -c Use the context output format. -C lines --context[=lines] Use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context. --changed-group-format=format Use format to output a line group containing differing lines from both files in if-then-else format. -d Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower). -D name Make merged if-then-else format output, conditional on the preprocessor macro name. -e --ed Make output that is a valid ed script. --exclude=pattern When comparing directories, ignore files and subdirectories whose basenames match pattern. --exclude-from=file When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in file. --expand-tabs Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files. -f Make output that looks vaguely like an ed script but has changes in the order they appear in the file. -F regexp In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp. --forward-ed Make output that looks vaguely like an ed script but has changes in the order they appear in the file. -h This option currently has no effect; it is present for Unix compatibility. -H Use heuristics to speed handling of large files that have numerous scattered small changes. --horizon-lines=lines Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix. -i Ignore changes in case; consider upper- and lower-case letters equivalent. -I regexp Ignore changes that just insert or delete lines that match regexp. --ifdef=name Make merged if-then-else format output, conditional on the preprocessor macro name. --ignore-all-space Ignore white space when comparing lines. --ignore-blank-lines Ignore changes that just insert or delete blank lines. --ignore-case Ignore changes in case; consider upper- and lower-case to be the same. --ignore-matching-lines=regexp Ignore changes that just insert or delete lines that match regexp. --ignore-space-change Ignore changes in amount of white space. --initial-tab Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal. -l Pass the output through pr to paginate it. -L label --label=label Use label instead of the file name in the context format and unified format headers. --left-column Print only the left column of two common lines in side by side format. --line-format=format Use format to output all input lines in in-then-else format. --minimal Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower). -n Output RCS-format diffs; like -f except that each command specifies the number of lines affected. -N --new-file In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory. --new-group-format=format Use format to output a group of lines taken from just the second file in if-then-else format. --new-line-format=format Use format to output a line taken from just the second file in if-then-else format. --old-group-format=format Use format to output a group of lines taken from just the first file in if-then-else format. --old-line-format=format Use format to output a line taken from just the first file in if-then-else format. -p Show which C function each change is in. -P When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other. --paginate Pass the output through pr to paginate it. -q Report only whether the files differ, not the details of the differences. -r When comparing directories, recursively compare any subdirectories found. --rcs Output RCS-format diffs; like -f except that each command specifies the number of lines affected. --recursive When comparing directories, recursively compare any subdirectories found. --report-identical-files -s Report when two files are the same. -S file When comparing directories, start with the file file. This is used for resuming an aborted comparison. --from-file=file Compare file to all operands. file can be a directory. --to-file=file Compare all operands to file. file can be a directory. --sdiff-merge-assist Print extra information to help sdiff. sdiff uses this option when it runs diff. This option is not intended for users to use directly. --show-c-function Show which C function each change is in. --show-function-line=regexp In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp. --side-by-side Use the side by side output format. --speed-large-files Use heuristics to speed handling of large files that have numerous scattered small changes. --starting-file=file When comparing directories, start with the file file. This is used for resuming an aborted comparison. --suppress-common-lines Do not print common lines in side by side format. -t Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files. -T Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal. --text Treat all files as text and compare them line-by-line, even if they do not appear to be text. -u Use the unified output format. --unchanged-group-format=format Use format to output a group of common lines taken from both files in if-then-else format. --unchanged-line-format=format Use format to output a line common to both files in if-then-else format. --unidirectional-new-file When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other. -U lines --unified[=lines] Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context. -v --version Output the version number of diff. -w Ignore white space when comparing lines. -W columns --width=columns Use an output width of columns in side by side format. -x pattern When comparing directories, ignore files and subdirectories whose basenames match pattern. -X file When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in file. -y Use the side by side output format. SEE ALSO
cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1). DIAGNOSTICS
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble. GNU Tools 22sep1993 DIFF(1)
All times are GMT -4. The time now is 02:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy