The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Getting modified time & filename only senthil_seera Shell Programming and Scripting 4 04-13-2008 01:50 PM
Find and store files based on FileName and Modified Time edisonantus UNIX for Advanced & Expert Users 2 02-19-2008 02:25 PM
how to retrieve original contents of a modified file (modified using vi) novice100 UNIX for Dummies Questions & Answers 3 05-31-2007 09:50 PM
who modified my file!! mohanprabu UNIX for Dummies Questions & Answers 4 10-28-2005 11:18 PM
Last Modified Date cengiz Shell Programming and Scripting 12 06-28-2005 03:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-08-2009
Ruks Ruks is offline
Registered User
  
 

Join Date: May 2009
Posts: 9
Question How to get a filename modified by attaching modified timestamp

Hi,

I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10).

For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I should get the filename changed to a.log200804062100. Please advise ..

Thanks in advance!!!
  #2 (permalink)  
Old 05-08-2009
Ruks Ruks is offline
Registered User
  
 

Join Date: May 2009
Posts: 9
can anyone post a reply to this at the earliest.. I m struck here and not able to proceed with my coding without this.. thanks in advance..
  #3 (permalink)  
Old 05-08-2009
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,556
what have you tried so far?
  #4 (permalink)  
Old 05-08-2009
Ruks Ruks is offline
Registered User
  
 

Join Date: May 2009
Posts: 9
I didn get any way to get the timestamp in numerical format...
  #5 (permalink)  
Old 05-08-2009
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Quote:
Originally Posted by Ruks View Post
I didn get any way to get the timestamp in numerical format...

Code:
date +%G%d%H%M%S
200908011027

Thanks
NT
  #6 (permalink)  
Old 05-08-2009
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,556
its the file's timestamp if i am not wrong, not the system time stamp.
  #7 (permalink)  
Old 05-08-2009
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Quote:
Originally Posted by ghostdog74 View Post
its the file's timestamp if i am not wrong, not the system time stamp.
Hi Ghostdog,

Yes you are correct, Sorry for not reading the question properly.
My post will simply give the current time stamp in numeric format.

Thanks
NT
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0