Solved

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

Posted on 2002-03-17
3
178 Views
Last Modified: 2010-04-22
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
Comment
Question by:jukes
  • 2
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6875400
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
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 6876117
perl -MDate::Manip -e 'print UnixDate("last month","%b");'
0
 

Author Comment

by:jukes
ID: 6880860
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now