Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

Unix shell script

How to create the file with time stamp in unix shell script ?
0
digs developer
Asked:
digs developer
1 Solution
 
nemws1Database AdministratorCommented:
Something like this?
DATE=`date "+%Y%m%d-%H%M%S"`
FILE="myfile_$DATE"
echo "this is something in my new file" > $FILE

Open in new window

0
 
ozoCommented:
Or do you mean this?
touch file

Open in new window

0
 
TintinCommented:
touch file_$(date +%Y%m%d)

or

echo "Some text" >file_$(date +%Y%m%d)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now