Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to reduce one day from this Ja 1

Status
Not open for further replies.

CALYAN

Programmer
Apr 23, 2001
39
US
how to reduce one day from this
Jan013.gz ---> it should be Jan012.gz

thanks
 
I used this to extract somepart of the date
FILENAME=$(date +%b%d)
printf $FILENAME

It generates output like this.?
Jan13(example)

But I need Jan13.gz

how to add this?

regards
s.kalyan
 
Try this

FILENAME=$(TZ=TZ+23;date +%b%d).gr
print $FILENAME

Jean Pierre.
 
The ';' can be omited :

FILENAME=$(TZ=TZ+23 date +%b%d).gr
print $FILENAME

Jean Pierre.
 
Hi it shows only current date Jan14.gz I want to reduce
one day from it. how to do?
 
The command works fine on my aix box (with ksh):

set -vx
FILENAME=$(TZ=TZ+23 date +%b%d).gr
print $FILENAME


FILENAME=$(TZ=TZ+23 date +%b%d).gr
+ + date +%b%d
+ TZ=TZ+23
FILENAME=jan13.gr
print $FILENAME
+ print jan13.gr
jan13.gr



Jean Pierre.
 
Try this:
Code:
FILENAME=$(date +%b)$(($(date +%d)-1)).gz

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top