Sponsored Content
Top Forums Shell Programming and Scripting calculate time from a given format Post 302503508 by rdcwayx on Thursday 10th of March 2011 06:16:48 PM
Old 03-10-2011
Learn from Primary school, you can combine the 1000 together.Smilie

Code:
awk -F:  '{printf "%10d\n", ($1*60*60+$2*60+$3)*1000}' infile

 

10 More Discussions You Might Find Interesting

1. AIX

calculate time

Hi, How do I calculate time? I need to create an alert if a process is running more than 30 minutes. I need to get the first time and then get another, calculate it if more than 30 mins and then alert it to pager. Can't find it in internet. Thanks in advance, itik (2 Replies)
Discussion started by: itik
2 Replies

2. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

3. UNIX for Dummies Questions & Answers

calculate the time

hello i want to display the time firstly when i run my shell script and after 25 min i want to display a message it says that the time left is 5 min. When the calculated time is 30 mins, the script should exit. can any one help me with that! Thanks in advance Regards :o (5 Replies)
Discussion started by: dndoon
5 Replies

4. Shell Programming and Scripting

calculate date format in a loop

I have to calculate the below in date format in the loop so tht it increases each day; can you please tell me how do I calculate the 1 v_my_DT = v_my_DT + 1. also I need to stop the loop; I am using it in do while statement i posted earlier It should be 20090506=20090505 + 1 Sorry v_my_dt is... (7 Replies)
Discussion started by: aronmelon
7 Replies

5. Shell Programming and Scripting

Need to calculate elapsed time

Hi there, How to calculate the elapsed time in minutes for a particular job run under unix. I tried the following $ ps -efo user,pid,etime,comm,args | grep myscript | grep -v grep | awk -F" " '{print $3}' OUTPUT: 01:02:49 I need to get this output in minutes. Can someone help me... (1 Reply)
Discussion started by: karthickrn
1 Replies

6. Programming

Calculate time to some date

Hello! I need to find how many days, hours and minutes remain to some specific date and I wonder why the following program shows incorrect values, such as 4 days 23 hours etc to 14:00 this Saturday from 17:33 today... #include <stdio.h> #include <time.h> int main() { time_t elaps,... (4 Replies)
Discussion started by: Sapfeer
4 Replies

7. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

8. Shell Programming and Scripting

Calculate age of a file | calculate time difference

Hello, I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes... I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes. To do... (10 Replies)
Discussion started by: worm
10 Replies

9. Shell Programming and Scripting

How to calculate time

Hello Guys, I am trying to calculate total hours and minutes a given user has used the system since the beginning of the current month. #!/usr/bin/sh hr=0 min=0 last $1 | grep -w `date "+%b"` | grep -v '\(0:.*\)' | grep -vw sshd | cut -c 66- | tr -d "\(\)" | cut -f1 -d ":" | grep -v '.*' |... (9 Replies)
Discussion started by: kasparov
9 Replies

10. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies
XvGetPortAttribute(3)					     Library Functions Manual					     XvGetPortAttribute(3)

Name
       XvGetPortAttribute - return current port attribute value

Syntax
       #include <X11/extensions/Xvlib.h>

       XvGetPortAttribute(Display *dpy, XvPortID port,
			  Atom attribute, int p_value);

Arguments
       dpy	   Specifies the connection to the X server.

       port	   Specifies the port, associated with the given display, for which the attribute values are to be returned.

       attribute   An  atom that identifies the attribute to be queried by this request.  Control atoms are obtained using the XInternAtom request
		   with a string from the following table.

       p_value	   Pointer to the location where the attribute value is written on return.

Description
       XvGetPortAttribute(3) returns the current value of the requested port attribute in the integer pointed to by  p_value.	The  attribute	is
       identified using an Atom that equates to the attribute name.  The XInternAtom request can be used with one of the strings below to return a
       matching Atom.

       Attribute String        Type		Default

       "XV_ENCODING"	       XvEncodingID	Server dependent
       "XV_HUE" 	       [-1000...1000]	0
       "XV_SATURATION"	       [-1000...1000]	0
       "XV_BRIGHTNESS"	       [-1000...1000]	0
       "XV_CONTRAST"	       [-1000...1000]	0

Returned Values
       [Success]
	       Returned if XvGetPortAttribute(3) completed successfully.

       [XvBadExtension]
	       Returned if the Xv extension is unavailable.

       [XvBadAlloc]
	       Returned if XvGetPortAttribute(3) failed to allocate memory to process the request.

Diagnostics
       [XvBadPort]
	       Generated if the requested port does not exist.

       [BadMatch]
	       Generated if the requested attribute atom does not specify an attribute supported by the adaptor.

See Also
       XvSetPortAttribute(3), XvPortNotify(3)

X Version 11							    libXv 1.0.4 					     XvGetPortAttribute(3)
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy