Leap year calculation

leapyear() { [ $(date -d "Dec 31, $1" +%j) == 366 ] && echo leap || echo not leap; }

By: taliver
2010-03-30 20:13:56

2 Alternatives + Submit Alt

What Others Think

Very nice, although it's possible to run into the y2038 problem on 32bit systems.
eightmillion · 585 weeks and 6 days ago
Phoenix is the capital and most populous city in Arizona, with 1,660,272 people (as of 2018). It is also the fifth most populous city in the United States, and the only state capital with a population of more than one million residents. MaxRemind top rank medical billing company of USA offers medical billing services in Phoenix, medical credentialing services and home health agency software in Houston.
stevematt · 21 weeks and 1 day ago
Guardians ought to comprehend that gaming is correspondingly a working piece of real orchestrating, similarly, it should not to be excused. Check this fixer online for getting more info. Gaming and other in each in any event, inclining sense, faint activities can keep up the mental new turn of events and progress of an individual.
Ahmed74 · 14 weeks and 6 days ago
Your remark about the Crayola tattoos was not conspirational neither one of the this subject was hazardous. Visit www.passivesentencechecker.com for more info. In any, a couple of individuals have made a ton of introduction concerning this issue.
Ahmed74 · 14 weeks and 6 days ago
You have given me another records this is an unavoidable result of information progress which might be in peril for the improvement of net. Once visit http://www.semicolonchecker.com/ for more info. Which has certainly changed our way of life.
Ahmed74 · 14 weeks and 6 days ago
There are a gigantic heap of stunning turns in the "200 Cigarettes" film that is making it boggling. You will get sensational data about how to do this better. Just have a look correct my punctuation online free i hope you will like it. Regardless epic stars are missing in this film, it is still inconceivably boggling.
Ahmed74 · 9 weeks and 4 days ago
?These days, even custom toys are a colossal stack of shaped to make them all the all the what's really captivating and ensures about. Click http://www.commacheckeronline.com/9-biggest-comma-and-punctuation-checker-mistakes-you-can-easily-avoid/ for more info?. There's an enormous energy for get along with toys and it's unbelievably simple to do them.?
Ahmed74 · 9 weeks and 4 days ago
One of my friends is born on a leap year. I wanted to give her a program of this so that we can calculate her upcoming birthdays. https://www.asphaltsealcoatingdirect.com/directory/california/sunnyvale-concrete-pros
SeanCosta · 9 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: