LinuxQuestions.org
Review your favorite Linux distribution.
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: 72

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,037

Rep: Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 07:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration