Sponsored Content
Top Forums Shell Programming and Scripting How to get previous month files Post 94189 by savitha on Wednesday 28th of December 2005 02:59:38 AM
Old 12-28-2005
Thank you but i don't want to use any script again...

My main aim is to get a string called "200511" into variable when the its dec 2005
and "200512" when its jan 2006 and '200601' when its feb 2006.

once i get it i can issue mdelete *pervmonth*.xls ( i have to logon to a FTP site and delete files).

In this case i don't think there is an issue of feb not having 30th and 31. becasue on feb 1st all jan files will be deleted.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file name using previous month

This has probably been asked 100 times, but I couldn't find any articles on point. I have a script that runs on the last day of every month at 11:30pm. If cats a number of input tables that were created the previous month (or earlier), combines them into one master file and erases the indivual... (1 Reply)
Discussion started by: beilstwh
1 Replies

2. Shell Programming and Scripting

Help, I need to get the last date of previous month

Hi, I'm new with Unix, I'm trying to get a last day of previous month with this format: %b %d %Y (example: Feb 25 2008). Here is what I have so far. #!/bin/ksh cur_month=`date +%m` cur_year=`date +%Y` prev_month=$(($cur_month-1)) # Check to see if this is January if then ... (11 Replies)
Discussion started by: sirrtuan
11 Replies

3. UNIX for Dummies Questions & Answers

How to get the previous month by using `date`

Hello, I'm new to shell scripting. We've develop a script which will grep a file on the search criteria, MON (Jan/Feb/Mar/etc). But we should set this sript in cron which will run on every first day of the month. The problem I'm having is, when I run the script, it is displaying the contents of... (7 Replies)
Discussion started by: suneelj
7 Replies

4. Shell Programming and Scripting

Function to get previous month

Can someone help me creating a function which will give me previous months. like for example if the date is 200902 and if i call my function and pass a parameter 2 i want to get 200812 as the answer. or if i pass 200902 with a parameter 7 then my function should give me the date as 200807. (1 Reply)
Discussion started by: Lincy
1 Replies

5. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

6. UNIX for Dummies Questions & Answers

date command - getting previous month

Hi, On any given day, I want to capture the month that has gone by - said otherwise, how do I capture last month? expr date '+%m' - 1 Above expression is giving error. Please advise thanks ---------- Post updated at 09:28 AM ---------- Previous update was at 09:11 AM... (1 Reply)
Discussion started by: ab_2010
1 Replies

7. UNIX for Dummies Questions & Answers

Get the previous month from date

Hi All, I am using the below code to get the year and month from date: Below gives output like 201212. dt=`date '+%Y%m'` how do i get the previous month value(ie: subtract 1 from date) example output: dt=201211 Please help. :confused: (3 Replies)
Discussion started by: abhi_123
3 Replies

8. Shell Programming and Scripting

Help with getting last date of previous month and first date of previous 4th month from current date

I have requirment to get last date of previous month and the first date of previous 4th month: Example: Current date: 20130320 (yyyymmdd) Last date of previous month: 20130228 (yyyymmdd) First date of previous 4th month: 20121101 (yyyymmdd) In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies

9. Shell Programming and Scripting

How to copy the previous month files using shell script?

could you please assist the below query. i had written the below piece of code to copy the files from one directory to another. For current month files had been copied ,unfortunately the previous month files not copied. Please find the below directory structure:- ls -lrt total 1824... (2 Replies)
Discussion started by: venkat918
2 Replies
DateTime::Locale::eo(3) 				User Contributed Perl Documentation				   DateTime::Locale::eo(3)

NAME
DateTime::Locale::eo SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'eo' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Esperanto. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) lundo mardo merkredo XaXdo vendredo sabato dimanXo Abbreviated (format) lu ma me Xa ve sa di Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) lundo mardo merkredo XaXdo vendredo sabato dimanXo Abbreviated (stand-alone) lu ma me Xa ve sa di Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) januaro februaro marto aprilo majo junio julio aXgusto septembro oktobro novembro decembro Abbreviated (format) jan feb mar apr maj jun jul aXg sep okt nov dec Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) januaro februaro marto aprilo majo junio julio aXgusto septembro oktobro novembro decembro Abbreviated (stand-alone) jan feb mar apr maj jun jul aXg sep okt nov dec Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) 1a kvaronjaro 2a kvaronjaro 3a kvaronjaro 4a kvaronjaro Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1a kvaronjaro 2a kvaronjaro 3a kvaronjaro 4a kvaronjaro Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated aK pK Narrow aK pK Date Formats Full 2008-02-05T18:30:30 = mardo, 5-a de februaro 2008 1995-12-22T09:05:02 = vendredo, 22-a de decembro 1995 -0010-09-15T04:44:23 = sabato, 15-a de septembro -10 Long 2008-02-05T18:30:30 = 2008-februaro-05 1995-12-22T09:05:02 = 1995-decembro-22 -0010-09-15T04:44:23 = -10-septembro-15 Medium 2008-02-05T18:30:30 = 2008-feb-05 1995-12-22T09:05:02 = 1995-dec-22 -0010-09-15T04:44:23 = -10-sep-15 Short 2008-02-05T18:30:30 = 08-02-05 1995-12-22T09:05:02 = 95-12-22 -0010-09-15T04:44:23 = -10-09-15 Default 2008-02-05T18:30:30 = 2008-feb-05 1995-12-22T09:05:02 = 1995-dec-22 -0010-09-15T04:44:23 = -10-sep-15 Time Formats Full 2008-02-05T18:30:30 = 18-a horo kaj 30:30 UTC 1995-12-22T09:05:02 = 9-a horo kaj 5:02 UTC -0010-09-15T04:44:23 = 4-a horo kaj 44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = mardo, 5-a de februaro 2008 18-a horo kaj 30:30 UTC 1995-12-22T09:05:02 = vendredo, 22-a de decembro 1995 9-a horo kaj 5:02 UTC -0010-09-15T04:44:23 = sabato, 15-a de septembro -10 4-a horo kaj 44:23 UTC Long 2008-02-05T18:30:30 = 2008-februaro-05 18:30:30 UTC 1995-12-22T09:05:02 = 1995-decembro-22 09:05:02 UTC -0010-09-15T04:44:23 = -10-septembro-15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008-feb-05 18:30:30 1995-12-22T09:05:02 = 1995-dec-22 09:05:02 -0010-09-15T04:44:23 = -10-sep-15 04:44:23 Short 2008-02-05T18:30:30 = 08-02-05 18:30 1995-12-22T09:05:02 = 95-12-22 09:05 -0010-09-15T04:44:23 = -10-09-15 04:44 Default 2008-02-05T18:30:30 = 2008-feb-05 18:30:30 1995-12-22T09:05:02 = 1995-dec-22 09:05:02 -0010-09-15T04:44:23 = -10-sep-15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 ma 1995-12-22T09:05:02 = 22 ve -0010-09-15T04:44:23 = 15 sa Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 ptm 1995-12-22T09:05:02 = 9:05 atm -0010-09-15T04:44:23 = 4:44 atm Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 ptm 1995-12-22T09:05:02 = 9:05:02 atm -0010-09-15T04:44:23 = 4:44:23 atm M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = ma, 2-5 1995-12-22T09:05:02 = ve, 12-22 -0010-09-15T04:44:23 = sa, 9-15 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = dec -0010-09-15T04:44:23 = sep MMMd (MMM d) 2008-02-05T18:30:30 = feb 5 1995-12-22T09:05:02 = dec 22 -0010-09-15T04:44:23 = sep 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = ma feb 5 1995-12-22T09:05:02 = ve dec 22 -0010-09-15T04:44:23 = sa sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = februaro 5 1995-12-22T09:05:02 = decembro 22 -0010-09-15T04:44:23 = septembro 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = ma februaro 5 1995-12-22T09:05:02 = ve decembro 22 -0010-09-15T04:44:23 = sa septembro 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = ma, 2008-2-5 1995-12-22T09:05:02 = ve, 1995-12-22 -0010-09-15T04:44:23 = sa, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 dec -0010-09-15T04:44:23 = -10 sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = ma, 2008 feb 5 1995-12-22T09:05:02 = ve, 1995 dec 22 -0010-09-15T04:44:23 = sa, -10 sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februaro 1995-12-22T09:05:02 = 1995 decembro -0010-09-15T04:44:23 = -10 septembro yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 K1 1995-12-22T09:05:02 = 1995 K4 -0010-09-15T04:44:23 = -10 K3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week lundo SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::eo(3)
All times are GMT -4. The time now is 06:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy