Solved

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

Posted on 2002-03-17
3
188 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CentOS 6.6 Port opening question 1 137
Debian 3 - initrd rebuild 3 80
Linux : Booting Error after restoring image from OLD PC 23 93
busybox bash/ash - bash -x | grep 19 154
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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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