Sponsored Content
Top Forums Shell Programming and Scripting How to get timestamp of file into ksh script Post 302310509 by sniper57 on Saturday 25th of April 2009 07:00:06 AM
Old 04-25-2009
Thanks for the replies.

Unfortunately I don't have the stat command available in my AIX envt.

The timestamp needs to be in this format : 20090425000000
so yyyymmddhhmmss

Maybe it would be easier to just write/append the timestamp to a file and read the last entry from that? I just feel there has to be a neater way of doing this!

How do I get the timestamp in the format I want from something like :
ls -l $FILE | awk '{sub(/:/,"",$8);print $8}' ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to get timestamp from a text file using ksh

for example : 07:25 Thanks (1 Reply)
Discussion started by: vinna
1 Replies

2. AIX

timestamp in .sh_history using ksh shell

Hello Everyone: Does anyone know how I will setup my account to put timestamp in my .sh_history? I do not hold the root account. I am using AIX 5 and ksh shell. I tried every solution I can find in the internet but nothing seems to work OR I am just applying those in the wrong way. Anyone knows... (4 Replies)
Discussion started by: Orbix
4 Replies

3. UNIX for Advanced & Expert Users

how to get timestamp of a file in a perl script

I have seen this posting here: perl -e '@d=localtime ((stat(shift))); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d,$d+1,$d+1900,$d,$d,$d' file1.txt I need to use it inside a perl script. Can anybody please help me out. (5 Replies)
Discussion started by: biswajeet.beher
5 Replies

4. Shell Programming and Scripting

Timestamp to date conversion in ksh

Hi, I have a file containing timestamp( Example given below). How can i get date(mmd-dd-yyyy) from it? ($> cat file1.txt 2008-11-24 05:17:00.7043) Thanks, Sri (2 Replies)
Discussion started by: srilaxmi
2 Replies

5. UNIX for Advanced & Expert Users

In ksh find out the timestamp of current date?

Normally we can use %s to find out the time in second since 1970. But in my ksh, this format option is not available. Example- date +%s 1268103151 above script command won't work in ksh. Can you guys provide its equivalent ? (3 Replies)
Discussion started by: boy18nj
3 Replies

6. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

7. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

8. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

9. Shell Programming and Scripting

How to get the timestamp for file using shell script

I am writing a script to move the executable from one node to another and take the backup of the existing one. For that I want to fetch the timestamp of file using shell script. Could anyone help? (2 Replies)
Discussion started by: gagankinra
2 Replies

10. Shell Programming and Scripting

Bash Script Closest Timestamp (LOG FILE)

Hi All, I need something where I could take the date from FILE1 and in this case the date is Thu Sep 10 13:48:42 EDT 2015 and I need it to match the closest PREVIOUS date in the log file FILE2 this means in this specific case it would be Thu Sep 10 2015 13:35:28. I only need the closest... (3 Replies)
Discussion started by: roberto999
3 Replies
RTCANRECV(1)							      Xenomai							      RTCANRECV(1)

NAME
rtcanrecv - Xenomai tool for receiving CAN messages SYNOPSIS
rtcanrecv [<can-interface>] [Options] DESCRIPTION
rtcanrecv is part of Xenomai. It is used to receive messages via a CAN interface. The system must run a suitable Xenomai enabled kernel with the respective module (xeno_native and the CAN driver). OPTIONS
<can-interface> is the CAN interface file. rtcanrecv accepts the following options: -f, --filter=id:mask[:id:mask]... apply filter -e, --error=mask receive error messages -t, --timeout=MS timeout in ms -T, --timestamp with absolute timestamp -R, --timestamp-rel with relative timestamp -v, --verbose be verbose -p, --print=MODULO print every MODULO message -h, --help this help SEE ALSO
rtcanconfig(1), rtcanrecv(1) AUTHORS
rtcanrecv was written by Wolfgang Grandegger <wg@grandegger.com>, Jan Kiszka <jan.kiszka@web.de> and Philippe Gerum <rpm@xenomai.org>. This man page was written by Roland Stigge <stigge@antcom.de>. 2.6.0 2008-04-19 RTCANRECV(1)
All times are GMT -4. The time now is 05:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy