List of Sundays for the years 2000 to 2005


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List of Sundays for the years 2000 to 2005
# 1  
Old 02-10-2005
List of Sundays for the years 2000 to 2005

hi,
i need to write a script that would list me all sundays in the year 2000 and 2005.

output need to be just the date .

Smilie
# 2  
Old 02-10-2005
here's the start:

Code:
#!/bin/ksh

typeset -i year=yearStart=2000
typeset -i yearEnd=2005

while (( year <= yearEnd ))
do
   for month in 1 2 3 4 5 6 7 8 9 10 12
   do
       #echo "${month}/${year}"
       cal "${month}" "${year}" | \
           nawk -v my="${month}/%s/${year}\n" 'NR>2 && NF {printf my, $NF}'}'
   done;
   (( year += 1 ))
done;


Last edited by vgersh99; 02-10-2005 at 04:13 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Ah, the AMIGA, (another poem I wrote in 2005).

Well I wrote this in 2005 and uploaded to AMINET.as a commemoration of a machine that is still in use today. It is now 29 years since this machne came into being. Phenominal and it is still being supported- WOW! My A1200 is on 24/7 and I use it to test code developed on AMIGA emulators... ... (0 Replies)
Discussion started by: wisecracker
0 Replies

2. Shell Programming and Scripting

Add previous Sundays date to filename

I am looking for some scripting help. I need to add a time stamp to a file name. I will append data to a file, and want to add to the file name a time stamp of the previous Sundays date. Any takers? (1 Reply)
Discussion started by: sswagner8839
1 Replies

3. Shell Programming and Scripting

Taking the count of sundays between two date ?

Hi Am using unix Ksh Datecalc and --date functions are not working have two input variables as DATE=01/12/2012 DATE1=23/12/2012 Need output as no of sundays = 4 Can anyone help me pls :( (2 Replies)
Discussion started by: Venkatesh1
2 Replies

4. UNIX for Advanced & Expert Users

How to take the count of all sundays between two dates?

Hi Am Using Unix Ksh I have input DATE1=01/11/2012 DATE2=10/12/2012 need output as count of all sundays between these two dates for examples Sunday count between DATE1 and DATE2 is 5 Can anyone help me... (11 Replies)
Discussion started by: Venkatesh1
11 Replies

5. Programming

Is VB 2005 not supportive of win 7 SP 1 ?

Dear All, I have tried to install Visual Basic 2005 on win 7 service pack 1. I have got the errors from my five time of trying. The error is as under: Error 1935. An error occurred during the installation of assembly 'Microsoft.VC80.ATL,type="win32", version="8.0.50727.42",publickey... (0 Replies)
Discussion started by: swapan
0 Replies

6. UNIX for Dummies Questions & Answers

Listing out sundays alone

I am trying to list out only sundays from december 2011. pandeeswaran@ubuntu:~/training$ cal 12 2011|sed -n '3,$p'|sed -e'/^$/d'|awk '{ORS=",";print $1}' 1,4,11,18,25,,pandeeswaran@ubuntu:~/training$ Can anyone help me? Thanks (13 Replies)
Discussion started by: pandeesh
13 Replies

7. UNIX Desktop Questions & Answers

count of sundays in month

Hi, How to get count of number of sundays in month in unix shell script .. ideally i need 2 get last sunday of month so i used cmd: for eg: for june: cal 06 2011 | tail -2 | head -1 | cut -d" " -f1 hoowever above is wrking for month whose sundays are max=4 but not fr months... (4 Replies)
Discussion started by: musu
4 Replies

8. UNIX for Dummies Questions & Answers

Unix Command to separate this years files and last years?

Hello - I have a folder that contains files from 2003 till 2010. I am trying to figure out a command that would seperate each years file and show me a count? Even if i can find a command that would give me year by year count, thats good enough too. Thanks (8 Replies)
Discussion started by: DallasT
8 Replies

9. UNIX for Dummies Questions & Answers

Installing HP-UX 11i Version 1 May 2005

Hi, I'm real novice as far as unix goes, I've been asked to help out and install HP UX on a HP RP3440 server. I have been given the CDs and a procedure. I've also been told that the CDs with the s/w is a bit old and will need to be updated. Once I have installed it, how can I verify what I need... (1 Reply)
Discussion started by: navaid
1 Replies

10. Shell Programming and Scripting

Cronjob on alternate sundays

I want to set the crontab job for one of my SIEBEL database to refresh it on alternate sundays. Is there anyway I can do it through cron please ? If not whats the alternative ? :confused: Thanks in advance. (6 Replies)
Discussion started by: abhi123
6 Replies
Login or Register to Ask a Question