get_last_month()
{
        thismonth=date +%m
        if [[ $thismonth -eq 12 ]];then
                lastmonth=1
        else
                (( lastmonth = thismonth - 1 ))
        fi
 
        case $lastmonth in
                1) month=”Jan”
                2) month=”Feb”
                3) month=”Mar”
                4) month=”Apr”
                5) month=”May”
                6) month=”Jun”
                7) month=”Jul”
                8) month=”Aug”
                9) month=”Sep”
                10) month=”Oct”
                11) month=”Nov”
                12) month=”Dec”
        esac
}

About troyski

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation