Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Unix shell Question
Hi ,
This is from one post in other shell group ..
I forgot who is the poster.
#! /bin/sh
year=`date +%Y` month=`date +%m` day=`date +%d`# day=`cal $month $year | grep . | fmt -1 | tail -1`
# figure out what yesterday was.
day=`expr "$day" - 1` case "$day" in 0) month=`expr "$month" - 1` case "$month" in 0) month=12 year=`expr "$year" - 1` ;; esac
# figure out the last day of the month
:$(cal $month $year)
day = $_
;;
esac
echo "$year$month$day"
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sakthi , Raj INET: rajan_sakthi_at_yahoo.com 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: ListGuru_at_fatcity.com (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).Received on Tue Mar 05 2002 - 16:18:23 CST