Need help in Inix script for finding duration


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help in Inix script for finding duration
# 1  
Old 02-13-2017
Need help in Inix script for finding duration

I have a file with time in it. I need to find the duration between the timestamp by subtracting second row from third row and so on. and wherever it is more than 30 minutes it should display start and end time which have been subtracted

file :
Code:
00:44:11
00:44:11
00:44:13
00:44:13
00:46:51
00:46:51
02:46:58 
03:47:10
08:47:10
08:47:11

so as 7th row minus 6th row time 2:46:58 - 00;46:51 is more than 30 minute so these time stamps should get displayed.
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, sample output, and code segments, as required by forum rules.

Last edited by Don Cragun; 02-13-2017 at 03:42 AM.. Reason: Add CODE and ICODE tags.
# 2  
Old 02-13-2017
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did not post homework, please explain the company you work for and the nature of the problem you are working on. And, tell us what operating system and shell you're using. Also, please show us what you have tried to solve this problem on your own.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.
# 3  
Old 02-14-2017
In addition to what Don said: Please explain what is Inix.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Duration Calculation

I have 2 variables startTime='122717 23:20' endTime='122817 0:40' how can i get the elapsed duration as like "1 hour 20 minutes" ? (8 Replies)
Discussion started by: vikram3.r
8 Replies

2. UNIX for Beginners Questions & Answers

Process duration

Hi , How can I check that for a single process, for example pagent for how much duration this process was up or down and also I need multiple entries if this process was down or up multiple times. Please help. (3 Replies)
Discussion started by: Ashish Garg
3 Replies

3. UNIX for Dummies Questions & Answers

Script shell calculate mean arrival request duration

hello, I have implemented this command : tshark -eth0 -T fiels -e frame.time et sip.Request-Line -z sip,stat > test2.txt the result of this command : test.txt: Aug 27, 2013 23:06:47.334270000 INVITE Aug 27, 2013 23:06:47.335045000 SIP/2.0 401 Unauthorized Aug 27, 2013... (1 Reply)
Discussion started by: Amouna
1 Replies

4. Shell Programming and Scripting

Sort by Duration

.......................................................................................................................... 03:40 Geonetric File from CCL Complete 03:40:59 03:41:08 00:00:09 00:00:01 N/A 005 sys_runccl ... (7 Replies)
Discussion started by: Daniel Gate
7 Replies

5. UNIX Desktop Questions & Answers

arecord not interrupted after specified duration

I have used the arecord command like this arecord -d 1 test.wav It is keep on waiting. I need to manually interrupt it by ctrl-c. Why it is not interrupting after one second? The arecord version which I am using is : arecord: version 1.0.23 by Jaroslav Kysela (3 Replies)
Discussion started by: thillai_selvan
3 Replies

6. Shell Programming and Scripting

Script that outputs user logins sorted by duration

Hello, I want to write a script that takes a username as input and outputs the user's logins sorted by duration. Also I want to exclude the "still logged in" entries. I use the "last" command but Im having problems sorting the entries based on the duration. Can you help me? Thanks a lot =) (4 Replies)
Discussion started by: ddante
4 Replies

7. UNIX for Dummies Questions & Answers

Copy duration of cp

Hello forum, i would like to ask if there's a way to view the remaining time of copying files (talking about copying gigabytes) while the cp commnad is running. I'm using OpenBSD 4.9 -stable. Thanx in advance. :) (2 Replies)
Discussion started by: sepuku
2 Replies

8. Solaris

ufsdump backup duration

hi, i'm trying to figure out how to tell the amount of time a ufsdump of a directory takes. i use the below command: echo "Starting Backup of u4" >> /backup/backup.log 2>&1 /usr/sbin/ufsdump 0uf /dev/rmt/0n /u4 >> /backup/backup.log 2>&1 echo "Finished Backup of u4" >> /backup/backup.log... (0 Replies)
Discussion started by: pinoy43v3r
0 Replies

9. Shell Programming and Scripting

duration calculation

I have a file which has 3 coloumns emp_name, Joining_date, Designation. abc 12/1/2001 SSE def 2/25/2007 SE ghi 3/18/2009 SA abc 8/1/2008 SSE def 2/13/2007 SE ghi 3/24/2005 SA I need to find out the emp who has been in the company for longest period(Till date). Can I have any... (3 Replies)
Discussion started by: siba.s.nayak
3 Replies

10. Solaris

Finding list of modified files for a particular time duration

Hi , I am trying to find out the List of files modified or added aftter installation of any component on SUN solaris box . But i am not able to do it using ls or find command . Can somebody help me out ? Thanks Sanjay Gupta (2 Replies)
Discussion started by: sanajyg_mnit
2 Replies
Login or Register to Ask a Question