• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

(Date +%b) need to change to previous month..

How do I get the script to change the (date +%b) this month to the previous month? I need this to grep some log files in linux. I do not know any perl, only just started learning some basic scriping.

-Jukes
0
jukes
Asked:
jukes
  • 2
1 Solution
 
ahoffmannCommented:
some linux support
  env TZ=GMT+744 date +%d
If your linux does not, the simplest way might be to to use perl with the Date::Manip module.
Let me know ..
0
 
ahoffmannCommented:
perl -MDate::Manip -e 'print UnixDate("last month","%b");'
0
 
jukesAuthor Commented:
I appreciate it very much. Don't know any perl as I mentioned, so I need to install Date::Manip module to perl, if there isn't one and that's it?
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now