Solved

Append Sysdate in Unix

Posted on 2002-04-08
5
1,340 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

758 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

19 Experts available now in Live!

Get 1:1 Help Now