Advertisement

02.12.2003 at 03:03AM PST, ID: 20510491
[x]
Attachment Details

append date time stamp to a batch of log file

Asked by hpchong7 in Linux

Tags: append, date, file

Dear all,

ls *.log | awk '{
                oldfile=$0;
                split($0,newfile,".");
                dtstamp=date;
                print "mv " oldfile " " newfile[1]"."xxx;
                }' > mv.sh

what should I put in the xxx such that the current day becomes the extension of the files? thank you very much!Start Free Trial
[+][-]02.12.2003 at 05:12AM PST, ID: 7933281

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.12.2003 at 08:02AM PST, ID: 7934522

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux
Tags: append, date, file
Sign Up Now!
Solution Provided By: prasadklk
Participating Experts: 2
Solution Grade: A
 
 
[+][-]02.12.2003 at 08:02AM PST, ID: 7934526

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.12.2003 at 08:50AM PST, ID: 7934887

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32