LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-27-2012, 05:30 AM   #1
ANU
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Solaris 10
Posts: 78

Rep: Reputation: 15
Question help with calendar with only week number


hello all,
im stuck, i couldnt find anywhere what i need
i tried to modify existing calendar scripts to show what i need, but no luck

please give me a push, a helping hand

this i how i imagine the calender will look like, i input the month and the year and it will generate a page like this:
http://img805.imageshack.us/img805/8458/calweeks.jpg

thanks for any help
 
Old 04-27-2012, 08:24 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Here's a hint: the date utility will return the current (today) week number thus:
Code:
date +%W
17
And,
Code:
date -d"04/15/2012" +%W
15
Another hint, there are 52 weeks in a year, in a loop set a variable starting at 1, stopping at 52; use that variable to print your strings.

Here's a simple example:
Code:
WEEK=1
while (( ${WEEK} <= 52 ))
do
	echo -n "${WEEK} link_report?weeknr=${WEEK}&auto=vw "
	echo -n "link_raport?weeknr=${WEEDK}&auto=audi "
	echo -n "link_raport?weeknr=${WEEK}&auto=nissan "
	echo "link_raport?weeknr=${WEEK}&auto=skoda"
	(( WEEK=WEEK+1 ))
done
Hope this helps some.

Last edited by tronayne; 04-27-2012 at 09:06 AM. Reason: Added three additional columns
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
any lang: week number ezekieldas Programming 13 03-30-2012 03:50 PM
[SOLVED] find to get the number of directories modified within last week ted_chou12 Linux - Software 6 11-24-2011 12:44 AM
Using gcaldaemon to synchronize calendar to google calendar seanybaby Linux - Software 1 12-15-2009 02:30 PM
How to share between Outlook Calendar and a Linux calendar program domino1241 Linux - General 2 07-09-2006 09:13 PM
Calculating the week number for american calendars traene Programming 3 04-23-2005 05:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration