-2

In Bourne shell, I need to know which dates belong to the same week. For example, week 16 in 2013 starts on April 22nd and ends on April 28th. Using the "date" command I can get the week number for a certain date but I need to go the other way around.

Thanks

user1641496
  • 457
  • 1
  • 8
  • 18
  • 1
    See this answer: http://stackoverflow.com/a/15606900/11621 this question is a duplicate of http://stackoverflow.com/questions/15606567/unix-date-how-to-convert-week-number-to-a-date-range-mon-sun (and I have no more votes today). – Zsolt Botykai Apr 22 '13 at 13:03
  • 1
    You can use `cal`, that shows you the calendar of current month. Then `grep` and these kind of things. – fedorqui Apr 22 '13 at 13:03
  • Is this your question: Given 2 integers, determine the dates contained in the specified week of the specified year. The first integer is a 4 digit number corresponding to a calendar year (i.e. 1998), the second integer is between 1 and 52 and represents a week of the year. Week 1 of a year would normally be a partial week. – Cargo23 Apr 22 '13 at 13:04

1 Answers1

1

A cheap way to obtain week numbers - Use ncal, the week numbers are output below calendar

e.g.

ncal -w 4 2013

or

ncal -w 2013
suspectus
  • 16,548
  • 8
  • 49
  • 57