Solved

Append Sysdate in Unix

Posted on 2002-04-08
5
1,342 Views
Last Modified: 2012-05-04
I am writing a shell script.

I wanted to append a file with the sysdate on it. Can someone help me with the unix command.

I tried mv filename filename'date'.out

Thanks all
0
Comment
Question by:cyberonics
5 Comments
 
LVL 6

Expert Comment

by:bira
ID: 6925780
mv filename filename`date`.out
0
 
LVL 6

Accepted Solution

by:
bira earned 5 total points
ID: 6925792
Or
  a=`date +"%d-%m-%Y"`
  mv filename filename$a.out
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6925920
mv filename filename`date +"%Y%m%d"`.out
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7833622
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by bira

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster (I don't work here, I'm just an Expert :-)
0
 

Expert Comment

by:modulo
ID: 7909013
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now