Assuming the file has not been modified since it was created then doing:
[code]
# ls -l file | awk '{ print "\n"$6" "$7 }' >> file
[code]
Will add the date and timestamp to the end of the file with a newline in front of it.
If after this you gzip the file then you can still view the contents of the file using either gzcat (link gzcat to gunzip if it does not yet exist) or use "gunzip -c", e.g.
will show the last line which will be added date and time.
I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second.
Any ideas... (1 Reply)
Hi,
can any one tell me how to achieve this...I will input the path and file name and it should rename it to current date and time...
this is what I tried...
#! /usr/bin/sh
set -x
cd /info_stg/vul/Scripts
TODAY_DATE_TIME=`date +%Y%m%d%H%M%S`
IN_FILE_PATH=`cat file.txt | awk -F, '{... (2 Replies)
Dear Gurus,
I'm trying to move a number of files from one directory to another directory with a new date stamp. This is my script:
#! /bin/csh
Today_Date=`date +%Y%M%D`
mv /usr/TRS/data/TS* /usr/TRS/backup/TS*.${Today_Date}
when i run the script i'm getting the following errors:
mv:... (14 Replies)
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
I have searched several thread and not found my solution, so I am posting a new qustion.
I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name.
I need to FTP the files to the MS server, but... (1 Reply)
Hi,
I am quite new to Perl scripting and i need to create a .TXT file using perl, with fields (A,B,C,D,E), and this text file should be named with current file creation date "XYZ_CCYYMMDD.TXT" (i.e.XYZ_2011042514:33 PM).
Can anyone who has done this, please share their expertise on this... (5 Replies)
hi,
i have some file names. my file names are as follows:
c_abc_new.txt.xls
c_def.txt.xls
i want to append date time stamp in the below manner.
c_abc_new_YYYYMMDD_HH24MISS.txt.xls
c_def_YYYYMMDD_HH24MISS.txt.xls
check the two input file names, they differ in naming. the 1st file name... (9 Replies)
Help with Perl script :
I have a web.xml file with a line
<display-name>some_text_here</display-name>
Need to append the current date and time stamp to the string and save the XML file
Something like
<display-name>some_text_here._01_23_2014_03_56_33</display-name>
-->Finally want... (5 Replies)
Hello Folks,
I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern.
Filename: MobileProtocol.20171228T154200.157115.udr
I want to get the count of files created on each day based on a pattern find.
find . -type... (7 Replies)
Discussion started by: sadique.manzar
7 Replies
LEARN ABOUT DEBIAN
log::agent::message
Agent::Message(3pm) User Contributed Perl Documentation Agent::Message(3pm)NAME
Log::Agent::Message - a log message
SYNOPSIS
require Log::Agent::Message;
my $msg = Log::Agent::Message->make("string");
$msg->prepend("string");
$msg->append("string");
my $copy = $msg->clone;
print "Message is $msg
"; # overloaded stringification
DESCRIPTION
The Log::Agent::Message class represents an original log message (a string) to which one may prepend or append other strings, but with the
special property that prepended strings aggregate themselves in FIFO order, whilst appended strings aggregate themselves in LIFO order,
which is counter-intuitive at first sight.
In plain words, this means that the last routine that prepends something to the message will get its prepended string right next to the
original string, regardless of what could have been prepended already. The behaviour is symetric for appending.
INTERFACE
The following routines are available:
append($str)
Append suppled string $str to the original string (given at creation time), at the head of all existing appended strings.
append_last($str)
Append suppled string $str to the original string (given at creation time), at the tail of all existing appended strings.
clone
Clone the message. This is not a shallow clone, because the list of prepended and appended strings is recreated. However it is not a
deep clone, because the items held in those lists are merely copied (this would matter only when other objects with overloaded
stringification routines were supplied to prepend() and append(), which is not the case today in the basic Log::Agent framework).
make($string)
This is the creation routine.
prepend($str)
Prepend supplied string $str to the original string (given at creation time), at the tail of all existing prepended strings.
prepend_first($str)
Prepend supplied string $str to the original string (given at creation time), at the head of all existing prepended strings.
stringify
This is the overloaded "" operator, which returns the complete string composed of all the prepended strings, the original string, and
all the appended strings.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent(3).
perl v5.10.0 2002-03-09 Agent::Message(3pm)