Sponsored Content
Full Discussion: Changing time-stamp with sed
Top Forums Shell Programming and Scripting Changing time-stamp with sed Post 302875415 by IMPe on Tuesday 19th of November 2013 12:23:25 PM
Old 11-19-2013
Quote:
Originally Posted by Corona688
Yes... and then showed an example that matched 1-5. Does he want to round down to ten minutes for low numbers, and up to ten minutes for high ones?

Being unsure, I showed him how backreferences worked and left the rest for him.
Thanks a lot to you and disedorgue and a big sorry for the imprecise description.
what a finally want, was rounding down the decade-minute and it works fine with
Code:
sed 's/:\([0-5]\)[1-5]:/:\10:/g'  file.txt

Thanks,
IMPe
This User Gave Thanks to IMPe For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to MV without changing Time Stamp

Hi, I need to move the set of files, and it should be same time stamp as previous. How to do this? (3 Replies)
Discussion started by: redlotus72
3 Replies

2. Shell Programming and Scripting

Date Time Stamp

I'm trying to write a script that checks the DTS of a file the compares it to the current time. If greater that 60 mins has gone by and the file has not been written to alert. So far I have the time pulled from the file but I dont know how to compare the times against a 60 min difference. ... (2 Replies)
Discussion started by: jarich
2 Replies

3. Shell Programming and Scripting

copying a file without changing date stamp.

Hi, I am using the below copy command, to copy the file sbn to sbn1, cp sbn sbn1 but its changing the date stamp of file sbn1, but i dont want to change the date stamp of sbn1. Could you please help me out in this. (3 Replies)
Discussion started by: shivanete
3 Replies

4. Shell Programming and Scripting

Time stamp calculation

Hi all; I'm relatively new to scripting,I am working on a monitoring script.....where in i have to write subroutine which does the follows: It will check the time stamp of a file ( Oracle remarchive files) and compare it with existing time.If the time difference happen to be more than 90... (6 Replies)
Discussion started by: maverick_here
6 Replies

5. Shell Programming and Scripting

Changing File Time Stamp (Bash Script)

I need some help recovering from a "slight" screwup. We just moved 3 TB of data from one RAID Array to another. Low lever archive files. This was done with a regular cp (for some reason) and now we have lost all the timestamps on the files, and we urgently need to get the timestamps back on these... (7 Replies)
Discussion started by: chj
7 Replies

6. UNIX for Dummies Questions & Answers

How to get the next time stamp in perl?

Hi, I have to find the next time stamp in perl. Here is the code. @time = loaltime(time); print "\n Present time: $time:$time:$time \n"; For example if the time is: "12:55:02" after some process the time becomes 1:00:00. How do i check when it becomes 00:00 i.e from "12:55:02... (0 Replies)
Discussion started by: vanitham
0 Replies

7. Shell Programming and Scripting

regarding time stamp

hi everyone i am facing a strange problem here suppose content of my file is a=1,2,3 b=2,3,4 c=4,5,6 time= now the problem is i want to add value in front of time variable and the value should be i format only "HHMMSS" so it should be like this a=1,2,3 b=2,3,4 c=4,5,6... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

8. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

9. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

10. Shell Programming and Scripting

Difference between time stamp

Hi All i have a file data like below format A, B 2016-04-14 16:30:00,2016-04-14 16:31:17 2016-04-14 16:40:00,2016-04-14 16:41:10 2016-04-14 16:50:00,2016-04-14 16:50:41 2016-04-14 17:00:00,2016-04-14 17:00:35 2016-04-14 17:10:00,2016-04-14 17:11:48 2016-04-14 17:20:00,2016-04-14 17:20:37 i... (2 Replies)
Discussion started by: Tarak_nath
2 Replies
fpgetround(3C)						   Standard C Library Functions 					    fpgetround(3C)

NAME
fpgetround, fpsetround, fpgetmask, fpsetmask, fpgetsticky, fpsetsticky - IEEE floating-point environment control SYNOPSIS
#include <ieeefp.h> fp_rnd fpgetround(void); fp_rnd fpsetround(fp_rnd rnd_dir); fp_except fpgetmask(void); fp_except fpsetmask(fp_except mask); fp_except fpgetsticky(void); fp_except fpsetsticky(fp_except sticky); DESCRIPTION
There are five floating-point exceptions: o divide-by-zero, o overflow, o underflow, o imprecise (inexact) result, and o invalid operation. When a floating-point exception occurs, the corresponding sticky bit is set(1), and if the mask bit is enabled(1), the trap takes place. These routines let the user change the behavior on occurrence of any of these exceptions, as well as change the rounding mode for floating- point operations. The mask argument is formed by the logical OR operation of the following floating-point exception masks: FP_X_INV /* invalid operation exception */ FP_X_OFL /* overflow exception */ FP_X_UFL /* underflow exception */ FP_X_DZ /* divide-by-zero exception */ FP_X_IMP /* imprecise (loss of precision) */ The following floating-point rounding modes are passed to fpsetround and returned by fpgetround(). FP_RN /* round to nearest representative number */ FP_RP /* round to plus infinity */ FP_RM /* round to minus infinity */ FP_RZ /* round to zero (truncate) */ The default environment is rounding mode set to nearest (FP_RN) and all traps disabled. The fpsetsticky() function modifies all sticky flags. The fpsetmask() function changes all mask bits. The fpsetmask() function clears the sticky bit corresponding to any exception being enabled. RETURN VALUES
The fpgetround() function returns the current rounding mode. The fpsetround() function sets the rounding mode and returns the previous rounding mode. The fpgetmask() function returns the current exception masks. The fpsetmask() function sets the exception masks and returns the previous setting. The fpgetsticky() function returns the current exception sticky flags. The fpsetsticky() function sets (clears) the exception sticky flags and returns the previous setting. USAGE
The C programming language requires truncation (round to zero) for floating point to integral conversions. The current rounding mode has no effect on these conversions. The sticky bit must be cleared to recover from the trap and proceed. If the sticky bit is not cleared before the next trap occurs, a wrong exception type may be signaled. Individual bits may be examined using the constants defined in <ieeefp.h>. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
isnand(3C), attributes(5) SunOS 5.11 29 Dec 1996 fpgetround(3C)
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy