The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-25-2008
cml2008 cml2008 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 12
Jim,

Excellent, that worked!

I see that I will have to take some time to decipher all of the parameters for printf in the man pages!

That being said, maybe you can help me know with the later half of the "if" statement.

if [ $MNTH!=01 ]
then
(( MNTH=$MNTH-01 ))
MNTH=$(printf "%02d" $MNTH)
YEAR=$YEAR
else
if [ $MNTH=01 ]
then
MNTH=12
(( YEAR=$YEAR-1 ))


in red now prints out as such 00/2009


again that is very cool about the printf, thanks for you help.