Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 04-27-2012, 05:30 AM   #1
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:

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

Rep: Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882
Here's a hint: the date utility will return the current (today) week number thus:
date +%W
date -d"04/15/2012" +%W
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:
while (( ${WEEK} <= 52 ))
	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 ))
Hope this helps some.

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


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 08:54 PM.

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