RE: Unix date ??
You can try following .. typeset -i this_mon this_mon=`date +%0m` echo $this_mon typeset -i prev_mon prev_mon=$this_mon-1 echo $prev_mon HTH, Rajesh -Original Message- Sent: Monday, July 30, 2001 3:16 PM To: Multiple recipients of list ORACLE-L Hi all, Unix... My boss ask me to write script for house keeping last month files what is the parameter to get system last month ? for example: thismonth=`date thismonth = thismonth - 1 is not working... regards, Sinardy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sinardy INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rajesh Dayal INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix date ??
What I have done instead is to use find with either ctime or mtime and then feed that to rm. something like: find . -ctime +30 -exec rm {} \; -Original Message- From: Sinardy [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 7:16 AM To: Multiple recipients of list ORACLE-L Subject: Unix date ?? Hi all, Unix... My boss ask me to write script for house keeping last month files what is the parameter to get system last month ? for example: thismonth=`date thismonth = thismonth - 1 is not working... regards, Sinardy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sinardy INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Page, Bruce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix date ??
Here is one way to do this: #!/usr/bin/ksh THISMM=`date +%m` LASTMM=`expr $THISMM - 1` if [ $LASTMM -eq 0 ] then LASTMM=12 fi echo This month $THISMM echo Last month $LASTMM HTH, Regards, - Kirti Deshpande Verizon Information Services http://www.superpages.com -Original Message- From: Sinardy [SMTP:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 6:16 AM To: Multiple recipients of list ORACLE-L Subject: Unix date ?? Hi all, Unix... My boss ask me to write script for house keeping last month files what is the parameter to get system last month ? for example: thismonth=`date thismonth = thismonth - 1 is not working... regards, Sinardy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sinardy INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Deshpande, Kirti INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).