?
Solved

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

Posted on 2002-03-17
3
Medium Priority
?
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 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