<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Number of days in a given month</title>
	<atom:link href="http://bashcurescancer.com/number_of_days_in_a_given_month.html/feed" rel="self" type="application/rss+xml" />
	<link>http://bashcurescancer.com/number_of_days_in_a_given_month.html</link>
	<description>Learn the UNIX/Linux command line</description>
	<lastBuildDate>Mon, 06 Jun 2011 01:35:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: diablomarcus</title>
		<link>http://bashcurescancer.com/number_of_days_in_a_given_month.html/comment-page-1#comment-47571</link>
		<dc:creator>diablomarcus</dc:creator>
		<pubDate>Wed, 13 Apr 2011 22:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/number_of_days_in_a_given_month.html#comment-47571</guid>
		<description>This would have proven useful for problem 19 of Project Euler. I didn&#039;t know how to do it in bash so did it in C instead :(</description>
		<content:encoded><![CDATA[<p>This would have proven useful for problem 19 of Project Euler. I didn&#8217;t know how to do it in bash so did it in C instead <img src='http://bashcurescancer.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodolfo</title>
		<link>http://bashcurescancer.com/number_of_days_in_a_given_month.html/comment-page-1#comment-47429</link>
		<dc:creator>Rodolfo</dc:creator>
		<pubDate>Sat, 26 Feb 2011 01:35:24 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/number_of_days_in_a_given_month.html#comment-47429</guid>
		<description>An easy solution... 

cal 1 `date +%Y` &#124; awk &#039;{ day=$0 } END { print day }&#039;</description>
		<content:encoded><![CDATA[<p>An easy solution&#8230; </p>
<p>cal 1 `date +%Y` | awk &#8216;{ day=$0 } END { print day }&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konstantin Bryzgalov</title>
		<link>http://bashcurescancer.com/number_of_days_in_a_given_month.html/comment-page-1#comment-24063</link>
		<dc:creator>Konstantin Bryzgalov</dc:creator>
		<pubDate>Thu, 13 Nov 2008 11:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/number_of_days_in_a_given_month.html#comment-24063</guid>
		<description>days_in_month(){
  [ &quot;$#&quot; == &quot;2&quot; ] &amp;&amp; date -d &quot;$1/01/$2 +1month -1day&quot; +%d
  [ &quot;$#&quot; == &quot;1&quot; ] &amp;&amp; days_in_month $1 `date +%Y`
  [ &quot;$#&quot; == &quot;0&quot; ] &amp;&amp; days_in_month `date +&#039;%m %Y&#039;`
}</description>
		<content:encoded><![CDATA[<p>days_in_month(){<br />
  [ "$#" == "2" ] &amp;&amp; date -d &#8220;$1/01/$2 +1month -1day&#8221; +%d<br />
  [ "$#" == "1" ] &amp;&amp; days_in_month $1 `date +%Y`<br />
  [ "$#" == "0" ] &amp;&amp; days_in_month `date +&#8217;%m %Y&#8217;`<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Redy</title>
		<link>http://bashcurescancer.com/number_of_days_in_a_given_month.html/comment-page-1#comment-122</link>
		<dc:creator>Redy</dc:creator>
		<pubDate>Wed, 24 Oct 2007 08:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://bashcurescancer.com/number_of_days_in_a_given_month.html#comment-122</guid>
		<description>More simple. With GNU version of date you dont ned cal. Use: date -d &quot;$MONTH/01/$YEAR +1month -1day&quot; +%d

days_in_month() { 
 if [ $# -gt 1 ]; then
    dim_y=$2
    dim_m=$1
 else
    if [ $# -eq 1 ]; then
      eval `date &quot;+dim_y=%Y&quot;`
      dim_m=$1
    else
      eval `date &quot;+dim_m=%m dim_y=%Y&quot;`
    fi
 fi
 date -d &quot;$dim_m/01/$dim_y +1month -1day&quot; +%d
}</description>
		<content:encoded><![CDATA[<p>More simple. With GNU version of date you dont ned cal. Use: date -d &#8220;$MONTH/01/$YEAR +1month -1day&#8221; +%d</p>
<p>days_in_month() {<br />
 if [ $# -gt 1 ]; then<br />
    dim_y=$2<br />
    dim_m=$1<br />
 else<br />
    if [ $# -eq 1 ]; then<br />
      eval `date &#8220;+dim_y=%Y&#8221;`<br />
      dim_m=$1<br />
    else<br />
      eval `date &#8220;+dim_m=%m dim_y=%Y&#8221;`<br />
    fi<br />
 fi<br />
 date -d &#8220;$dim_m/01/$dim_y +1month -1day&#8221; +%d<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.202 seconds -->
<!-- Cached page served by WP-Cache -->

