Sponsored Content
Top Forums Shell Programming and Scripting how to get 3rd week of every friday? Post 302690387 by itkamaraj on Thursday 23rd of August 2012 02:36:50 AM
Old 08-23-2012
another one to calculate the 3rd friday date

Code:
 
$ cal 12 2012 | nawk 'NR==4{if($6>7){fri=$6+7}else{fri=$6+14}}END{print fri}'      
21
$ cal 01 2012 | nawk 'NR==4{if($6>7){fri=$6+7}else{fri=$6+14}}END{print fri}' 
20
$ cal 11 2012 | nawk 'NR==4{if($6>7){fri=$6+7}else{fri=$6+14}}END{print fri}' 
16
$ cal | nawk 'NR==4{if($6>7){fri=$6+7}else{fri=$6+14}}END{print fri}'
17

These 2 Users Gave Thanks to itkamaraj For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to identify week-1 and week-2

Hello Friends I have three dirs 1. /home/main-bkup 2. /home/bkup-week1 3. /home/bkup-week2 Now we copy backups in 1 initially, then on 1st week we copy few content of 1 into 2 and then run some scripts on that. Then in 2nd week we keep 2 untouched and do the same thing in 3. So I... (1 Reply)
Discussion started by: csaha
1 Replies

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

3. Shell Programming and Scripting

Friday afternoon headache

Hi all, It's been a long week and my brain is clearly not functioning right so hopefully someone can help me out here. I've got a function in a script which just checks if a MySQL database directory exists or not. Code is as follows: dbCheck2() { if ; then { : # carry... (4 Replies)
Discussion started by: _Spare_Ribs_
4 Replies

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

5. Shell Programming and Scripting

pickup until last friday files from directory

Freinds, I need help: I need to process number of flat files on weekly basis. My source dir will receive flat files regulary at mid night between 1:00am and 6:00am. When I run my weekly file process it should get only the files which are until last friday (including friday)and move them in... (1 Reply)
Discussion started by: magi
1 Replies

6. Shell Programming and Scripting

Last friday of every month

Hi, I need to get the date of last friday of every month. how can i achieve this ? please guide me. Thanks in advance (3 Replies)
Discussion started by: apsprabhu
3 Replies

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

8. 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::fo(3) 				User Contributed Perl Documentation				   DateTime::Locale::fo(3)

NAME
DateTime::Locale::fo SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'fo' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Faroese. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) manadagur tysdagur mikudagur hosdagur friggjadagur leygardagur sunnudagur Abbreviated (format) man tys mik hos fri ley sun Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) manadagur tysdagur mikudagur hosdagur friggjadagur leygardagur sunnudagur Abbreviated (stand-alone) man tys mik hos fri ley sun Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) januar februar mars april mai juni juli august september oktober november desember Abbreviated (format) jan feb mar apr mai jun jul aug sep okt nov des Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) januar februar mars april mai juni juli august september oktober november desember Abbreviated (stand-alone) jan feb mar apr mai jun jul aug sep okt nov des Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide fyrir Krist eftir Krist Abbreviated f.Kr. e.Kr. Narrow f.Kr. e.Kr. Date Formats Full 2008-02-05T18:30:30 = tysdagur 05 februar 2008 1995-12-22T09:05:02 = friggjadagur 22 desember 1995 -0010-09-15T04:44:23 = leygardagur 15 september -10 Long 2008-02-05T18:30:30 = 5. feb 2008 1995-12-22T09:05:02 = 22. des 1995 -0010-09-15T04:44:23 = 15. sep -10 Medium 2008-02-05T18:30:30 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 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 = 05-02-2008 1995-12-22T09:05:02 = 22-12-1995 -0010-09-15T04:44:23 = 15-09--010 Time Formats Full 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 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 = tysdagur 05 februar 2008 18:30:30 UTC 1995-12-22T09:05:02 = friggjadagur 22 desember 1995 09:05:02 UTC -0010-09-15T04:44:23 = leygardagur 15 september -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 5. feb 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22. des 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15. sep -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 05-02-2008 18:30:30 1995-12-22T09:05:02 = 22-12-1995 09:05:02 -0010-09-15T04:44:23 = 15-09--010 04:44:23 Short 2008-02-05T18:30:30 = 05-02-08 18:30 1995-12-22T09:05:02 = 22-12-95 09:05 -0010-09-15T04:44:23 = 15-09--10 04:44 Default 2008-02-05T18:30:30 = 05-02-2008 18:30:30 1995-12-22T09:05:02 = 22-12-1995 09:05:02 -0010-09-15T04:44:23 = 15-09--010 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 tys 1995-12-22T09:05:02 = 22 fri -0010-09-15T04:44:23 = 15 ley HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 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 = tys, 2-5 1995-12-22T09:05:02 = fri, 12-22 -0010-09-15T04:44:23 = ley, 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 = des -0010-09-15T04:44:23 = sep MMMd (d. MMM) 2008-02-05T18:30:30 = 5. feb 1995-12-22T09:05:02 = 22. des -0010-09-15T04:44:23 = 15. sep MMMEd (E MMM d) 2008-02-05T18:30:30 = tys feb 5 1995-12-22T09:05:02 = fri des 22 -0010-09-15T04:44:23 = ley sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = februar 5 1995-12-22T09:05:02 = desember 22 -0010-09-15T04:44:23 = september 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = tys februar 5 1995-12-22T09:05:02 = fri desember 22 -0010-09-15T04:44:23 = ley september 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 = tys, 2008-2-5 1995-12-22T09:05:02 = fri, 1995-12-22 -0010-09-15T04:44:23 = ley, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 des -0010-09-15T04:44:23 = -10 sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = tys, 2008 feb 5 1995-12-22T09:05:02 = fri, 1995 des 22 -0010-09-15T04:44:23 = ley, -10 sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februar 1995-12-22T09:05:02 = 1995 desember -0010-09-15T04:44:23 = -10 september 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 yyyyMM (MM-yyyy) 2008-02-05T18:30:30 = 02-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 09--010 yyyyMMM (MMM y) 2008-02-05T18:30:30 = feb 2008 1995-12-22T09:05:02 = des 1995 -0010-09-15T04:44:23 = sep -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week manadagur 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.2 2013-08-25 DateTime::Locale::fo(3)
All times are GMT -4. The time now is 03:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy