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
DING(1) 							 Debian GNU/Linux							   DING(1)

NAME
ding - dictionary lookup program for Unix SYNOPSIS
ding [options] [phrase] DESCRIPTION
ding is a dictionary lookup program for X Windows/Unix. It comes with a German-English dictionary with about 270,000 entries. It is based on Tk version >= 8.3 and uses the agrep(1) or egrep(1) tools for searching. In addition to this ding can also search using ispell(1) and dict(1). It has many configuration options, such as search preferences, interface language (English or German), colors. It has history and help functions and comes with useful key and mouse bindings for quick and easy lookups. If you enter some word or phrase as command line argument, ding will start up with a translation of this word/phrase. OPTIONS
-x, --selection Start searching for selected word (X selection). -m, --mini Start with minimal size (search form only). -r, --remote Start search in an already running program. -R, --remote-new Start search in an already running program or start a new program. --noconf Do not save preferences -D #, --debug # Start with debug output, # = number (1..15). USAGE
It's very simple: Start ding (via KDE menu "Tools" or via command line), type in search word, press ENTER, read results. Search further by double-clicking a word, or select a word in another window and drop it by clicking with mouse button 2 over the "ding window". For further information consult the program help by pressing F1. SEE ALSO
agrep(1), egrep(1), ispell(1), ding(1). http://www.tu-chemnitz.de/~fri/ding/ /usr/share/doc/ding/html/index.html AUTHOR
ding was written by Frank Richter <frank.richter@hrz.tu-chemnitz.de>. This manual page was written by Roland Rosenfeld <roland@spinnaker.de>, for the Debian GNU/Linux system (but may be used by others). Debian Project March 2011 DING(1)
All times are GMT -4. The time now is 02:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy