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`

        # 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
# day=`cal $month $year | grep . | fmt -1 | tail -1`
    :$(cal $month $year)
    day = $_
    ;;
        esac

        echo "$year$month$day"




__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Sakthi , Raj
  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).

Reply via email to