CheeseConQueso
CheeseConQueso

Reputation: 6041

Shell script datetime function?

I am running the following script:

#!/bin/ksh
./clear_old
./rooms_xls.pl 2/23/09
cd doors
./doors_xls.pl 2/23/09

How can I get the date to be today's date based upon the system/server time?

Upvotes: 1

Views: 2412

Answers (3)

anon
anon

Reputation:

Use backticks with the date command:

./rooms_xls.pl `date +%m/%d/%Y`

Upvotes: 1

mouviciel
mouviciel

Reputation: 67831

This should work fine (and be almost compliant with your format):

#!/bin/ksh
./clear_old
./rooms_xls.pl `date +%D`
cd doors
./doors_xls.pl `date +%D`

Upvotes: 2

CheeseConQueso
CheeseConQueso

Reputation: 6041

$(date)

works

Upvotes: 1

Related Questions