Sponsored Content
Full Discussion: Last friday of every month
Top Forums Shell Programming and Scripting Last friday of every month Post 302211806 by fpmurphy on Friday 4th of July 2008 01:33:04 PM
Old 07-04-2008
Code:
#!/bin/ksh93

year=2008
for month in jan feb mar apr may jun jul aug sep oct nov dec
do
   printf "%(%D)T\n" "last friday in ${month} ${year}"
done

exit 0

outputs
Code:
01/25/08
02/29/08
03/28/08
04/25/08
05/30/08
06/27/08
07/25/08
08/29/08
09/26/08
10/31/08
11/28/08
12/26/08

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help, Every friday in a month

I am trying to write a script that shows every Friday in a month. I used cal $1 $2 | grep -v "^$" | awk '{print $6}' It doesn't work for the frist week of Friday because calendar command output has some spaces in the first line and awk '{print $6}' doesn't work. Anybody help me with this... (3 Replies)
Discussion started by: LAY
3 Replies

2. Shell Programming and Scripting

how can i find the third friday of each month?

Help please! I need to read the calendar and put the date of the third Friday of each month into a variable for comparison in an "if" statement. How would I do this? Thnx, leslie02 (10 Replies)
Discussion started by: leslie02
10 Replies

3. 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

4. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

5. Shell Programming and Scripting

cron job to run on second to last friday each month

I needed a cron job to run on the second to last friday of every month. Our servers are running HP-UX, and the HP-UX date command is pretty basic and does not have all of the fancy options that Linux date command does, and it does not have the ability at all to return future dates. So I had to... (0 Replies)
Discussion started by: lupin..the..3rd
0 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Cron - job to run every 3rd Friday of the month only

Hi Expert Please help me to set a cron job schedule, Ihave a job that run every 3rd Friday of the month at 1030am. I tried to set up like this, but the job still runs every friday at 1030am. I want the job to run every 3rd Friday of the month at 1030am only 30 10 15,16,17,18,19,20,21... (2 Replies)
Discussion started by: kaibiganmi
2 Replies

7. Red Hat

How to find/display out last Friday's date of the month?

Hello, Can you please help me find/display out last Friday's date of the month using command in Unix/Linux (3 Replies)
Discussion started by: sunnysthakur
3 Replies

8. Shell Programming and Scripting

How to add decimal month to some month in sql, php, perl, bash, sh?

Hello, i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m i need to write this script in php or bash or sh or mysql or perl in normal time o unix time i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Discussion started by: bacarrdy
14 Replies

9. Shell Programming and Scripting

Need last month files after 10th of every month

Hi, I need all file names in a folder which has date >= 10th of last month, Example : files in folder AUTO_F1_20140610.TXT BUTO_F1_20140616.TXT CUTO_F1_20140603.TXT FA_AUTO_06012014.TXT LA_AUTO_06112014.TXT MA_AUTO_06212014.TXT ZA_AUTO_06232014.TXT Output: AUTO_F1_20140610.TXT... (9 Replies)
Discussion started by: nani1984
9 Replies

10. Linux

Bash Display First Friday of the next month

Hello, I need to find the date of next first Friday of the month and set as a variable in a bash script ie - FIRSTFRIDAY=$(date -dfirst-friday +%d) I know date -dfirst-friday doesn't work, but unsure if I can use this / cal + awk or something else to find the right date of the... (7 Replies)
Discussion started by: summerdays
7 Replies
DateTime::Locale::kl_GL(3)				User Contributed Perl Documentation				DateTime::Locale::kl_GL(3)

NAME
DateTime::Locale::kl_GL SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'kl_GL' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Kalaallisut Greenland. DATA
This locale inherits from the DateTime::Locale::kl locale. It contains the following data. Days Wide (format) ataasinngorneq marlunngorneq pingasunngorneq sisamanngorneq tallimanngorneq arfininngorneq sabaat Abbreviated (format) ata mar pin sis tal arf sab Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) ataasinngorneq marlunngorneq pingasunngorneq sisamanngorneq tallimanngorneq arfininngorneq sabaat Abbreviated (stand-alone) ata mar pin sis tal arf sab Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) januari februari martsi aprili maji juni juli augustusi septemberi oktoberi novemberi decemberi Abbreviated (format) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) januari februari martsi aprili maji juni juli augustusi septemberi oktoberi novemberi decemberi Abbreviated (stand-alone) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = marlunngorneq 05 februari 2008 1995-12-22T09:05:02 = tallimanngorneq 22 decemberi 1995 -0010-09-15T04:44:23 = arfininngorneq 15 septemberi -10 Long 2008-02-05T18:30:30 = 05 februari 2008 1995-12-22T09:05:02 = 22 decemberi 1995 -0010-09-15T04:44:23 = 15 septemberi -10 Medium 2008-02-05T18:30:30 = feb 05, 2008 1995-12-22T09:05:02 = dec 22, 1995 -0010-09-15T04:44:23 = sep 15, -10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = feb 05, 2008 1995-12-22T09:05:02 = dec 22, 1995 -0010-09-15T04:44:23 = sep 15, -10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC Long 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC Medium 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM Short 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Default 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM Datetime Formats Full 2008-02-05T18:30:30 = marlunngorneq 05 februari 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = tallimanngorneq 22 decemberi 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = arfininngorneq 15 septemberi -10 4:44:23 AM UTC Long 2008-02-05T18:30:30 = 05 februari 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = 22 decemberi 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = 15 septemberi -10 4:44:23 AM UTC Medium 2008-02-05T18:30:30 = feb 05, 2008 6:30:30 PM 1995-12-22T09:05:02 = dec 22, 1995 9:05:02 AM -0010-09-15T04:44:23 = sep 15, -10 4:44:23 AM Short 2008-02-05T18:30:30 = 05/02/08 6:30 PM 1995-12-22T09:05:02 = 22/12/95 9:05 AM -0010-09-15T04:44:23 = 15/09/-10 4:44 AM Default 2008-02-05T18:30:30 = feb 05, 2008 6:30:30 PM 1995-12-22T09:05:02 = dec 22, 1995 9:05:02 AM -0010-09-15T04:44:23 = sep 15, -10 4:44:23 AM 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 mar 1995-12-22T09:05:02 = 22 tal -0010-09-15T04:44:23 = 15 arf 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 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM 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 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM 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 = mar, 2-5 1995-12-22T09:05:02 = tal, 12-22 -0010-09-15T04:44:23 = arf, 9-15 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 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 = mar feb 5 1995-12-22T09:05:02 = tal dec 22 -0010-09-15T04:44:23 = arf sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = februari 5 1995-12-22T09:05:02 = decemberi 22 -0010-09-15T04:44:23 = septemberi 15 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 februari 1995-12-22T09:05:02 = 22 decemberi -0010-09-15T04:44:23 = 15 septemberi MMMMEd (E MMMM d) 2008-02-05T18:30:30 = mar februari 5 1995-12-22T09:05:02 = tal decemberi 22 -0010-09-15T04:44:23 = arf septemberi 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 = mar, 2008-2-5 1995-12-22T09:05:02 = tal, 1995-12-22 -0010-09-15T04:44:23 = arf, -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 = mar, 2008 feb 5 1995-12-22T09:05:02 = tal, 1995 dec 22 -0010-09-15T04:44:23 = arf, -10 sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februari 1995-12-22T09:05:02 = 1995 decemberi -0010-09-15T04:44:23 = -10 septemberi 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 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = februari 2008 1995-12-22T09:05:02 = decemberi 1995 -0010-09-15T04:44:23 = septemberi -10 Miscellaneous Prefers 24 hour time? No Local first day of the week sabaat 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::kl_GL(3)
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy