Sponsored Content
Full Discussion: Sum talk time in bash
Top Forums UNIX for Beginners Questions & Answers Sum talk time in bash Post 303020288 by dragonfly85 on Monday 16th of July 2018 09:06:54 AM
Old 07-16-2018
Sum talk time in bash

Hello, guys !
I need a little help Smilie

Lets say i have log files with "n" calls like this one :

Code:
""""" <+825080825462>","+825080825462","60197774588","from-internal",
"SIP/518-00013e14","SIP/eu.test.com_outgoing-00013e15","Dial",
"SIP/eu.test.com_outgoing/001110260196544577,300,T","2018-01-08 02:40:10",
"2018-01-08 02:40:47","2018-01-08 02:40:54","44.132781","56.755853","ANSWERED",

Talk time is 56 seconds (56.755853). I need command line, which sums the total talk time for the whole file.

Regards,
DF
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash script, pattern matching + sum

Hi guys, i have been struggling to achieve the following and therefor looking for some help. I am trying to write something that will summerize the following output from my switches for daily totals. Basicly if $1 $2 $3 doesnt change, we can keep adding up $4. Probably would use a awk print end... (3 Replies)
Discussion started by: Wratholix
3 Replies

2. Shell Programming and Scripting

Bash time and programming

I have inherited a C++ program which does not manage it's memory at all. It has a whole bunch of 'new' variables without many deletes. I believe it was the programmers intent to let the OS clean up. Correct me if I am wrong, but I believe the unix/linux systems clean up after the program... (1 Reply)
Discussion started by: JDKunk
1 Replies

3. Shell Programming and Scripting

Print sum and relative value of the sum

Hi i data looks like this: student 1 Subject1 45 55 Subject2 44 55 Subject3 33 44 // student 2 Subject1 45 55 Subject2 44 55 Subject3 33 44 i would like to sum $2, $3 (marks) and divide each entry in $2 and $3 with their respective sums and print for each student as $4 and... (2 Replies)
Discussion started by: saint2006
2 Replies

4. Shell Programming and Scripting

How to compare time in bash script?

Hi, Anyone know how to compare the time in bash script? I want to compare say 30 min. to 45 min. ( AIX ) Thanks. (1 Reply)
Discussion started by: sumit30
1 Replies

5. Shell Programming and Scripting

Comparing time is bash

Hi, I have a question on comparing time using bash. Tried searching a lot up but couldn't figure it out. So I have this: CURRENT_TIME=$(date +%H:%M) if then echo "Continue" else echo "Quit" fi I tried a lot of different combinations of comparing, but nothing seems to work. Any help... (2 Replies)
Discussion started by: r4v3n
2 Replies

6. Shell Programming and Scripting

Time Stap Diff using Bash

hi all kindly i want to subtract to time stamps like: t1=08:35:20 t2=08:36:58 diff=00:01:38 <<<< or diff=01:38 <<<< using bash thanks alot (9 Replies)
Discussion started by: teefa
9 Replies

7. Shell Programming and Scripting

Bash Script Looping all the time

Hello, I have a database file, named data.txt, and a shell script (convert.sh) to convert data.txt from columns to row. Output file name will be column_to_row.txt In this example data.txt has only four rows. Format of data.txt is: info name surname telefon_nr Data.txt info boris... (1 Reply)
Discussion started by: baris35
1 Replies

8. Shell Programming and Scripting

Bash Sum up for spezific Numbers

Hello everyone, I need your assistance with bash. I want to sum up some numbers, that's not the big problem i think, but the values i want to some depending on another number. For example, I have a file with some rows of content. Number 1, Number 2, other content. I want to sum up number... (4 Replies)
Discussion started by: Bruder_Bruno
4 Replies

9. Shell Programming and Scripting

Script in bash that works only some of the time

I ran this script yesterday (in the background) /usr/bin/nohup myfilelocation/myscriptname.sh & the script worked perfectly. i ran it today (also in the background) and just sat there. So i killed it and ran it normally and it worked perfectly. Anyone suggest why it just sat there and... (8 Replies)
Discussion started by: twinion
8 Replies

10. Shell Programming and Scripting

Basic Bash algorithm with sum/subtraction

Hi all, i'm making some test on a data file. Imagine i have two columns inside it : 80377,20 80377,20 80379,19 80378,20 80380,20 80382,20 80381,21 Just to understand how can it works, imagine to subtract 100 to the number in the first column when the other one in the second... (4 Replies)
Discussion started by: Board27
4 Replies
sip_add_header(3SIP)				   Session Initiation Protocol Library Functions			      sip_add_header(3SIP)

NAME
sip_add_header - add a SIP header to the SIP message SYNOPSIS
cc [ flag ... ] file ... -lsip [ library ... ] #include <sip.h> int sip_add_header(sip_msg_t sip_msg, char *header_string); DESCRIPTION
The sip_add_header() function takes the SIP header header_string, adds a CRLF (carriage return/line feed) and appends it to the SIP message sip_msg. The sip_add_header() function is typically used when adding a SIP header with multiple values. RETURN VALUES
The sip_add_header() function returns 0 on success and the appropriate error value on failure. ERRORS
On failure, the sip_add_header() function can return one of the following error values: EINVAL Mandatory parameters are not provided, i.e. null. EPERM The message cannot be modified. ENOMEM Error allocating memory for creating headers/parameters. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
libsip(3LIB) SunOS 5.11 09 Feb 2007 sip_add_header(3SIP)
All times are GMT -4. The time now is 10:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy