Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Month manipulation in script

Status
Not open for further replies.

qzq17j

Programmer
Jan 6, 2002
1
US
Please respond, how can I manipulate month, for example I want to run a script every month by extracting data of the previous month from a file. I know how to code overlapping year once I know how to find out previous month and previous year from the current date. Any suggestions ?
 
Just a thought, but why not do it the easy way. I assume you are storing the file as something like "file2001-01". So why not make a symbolic link "ln -s file2001-01 lastmonth". Then in your script just look for the file "lastmonth". At the end of the script, delete the "lastmonth" file and create a new symbolic link.
 
Hmmmm I can do it in Perl, is that any good to you? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top