Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Command line monthly calendar
granger
follow
0
4-9-2007 10:34 PM
340 views
tags:
lifehacker
,
terminal
,
calendar
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Mindblowing Ice Sculptures
What Is the Speed of Thought?
Haunted cemeteries
Prince William Sleeps rough in London
Peace of Mind
Snowy scenes
Meet 'Giant George' the 7ft-long blue great dane who could be the world's tallest dog
30 Unusual and Incredible Surreal Artworks
On the Internet
MERRY CHRISTMAS!!
visit the
Top Clips page
View the Top Clips from
April 9, 2007
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/393505c2-8010-4425-8787-def13b14f150/80CBA6E0-A7EB-46BC-A183-78C0CA66BE4E/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://lifehacker.com/software/cli/cli-fun--todays-date-on-a-yearly-calendar-250825.php" href="http://lifehacker.com/software/cli/cli-fun--todays-date-on-a-yearly-calendar-250825.php" style="font-size: 11px;">lifehacker.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://lifehacker.com/software/cli/cli-fun--todays-date-on-a-yearly-calendar-250825.php"><BLOCKQUOTE>cal -y | tr '\n' '|' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /$(date +%m | sed s/^0//)" | tr '|' '\n'</BLOCKQUOTE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://lifehacker.com/software/cli/cli-fun--todays-date-on-a-yearly-calendar-250825.php"><BLOCKQUOTE>Explanation of additions: | tr '\n' '|' | This takes the output of cal -y (whole year), translates any new lines "\n" to pipe symbols "|" and passes it along to the mostly original regex $(date +%m | sed s/^0//) Putting this at the end of the 3rd regex in the sed says "Match the Nth time you find this". date +%m is the month, it's piped to sed to strip off any leading 0's (sed can't cope with leading 0's). | tr '|' '\n'<BR /><DIV> Turns pipes back into newlines.</DIV> I did some quick testing and it all seems hunky-dory for future months. I'm sure I'm not the first person to figure it out, but I did do it on my own building off of the original article.</BLOCKQUOTE></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/80CBA6E0-A7EB-46BC-A183-78C0CA66BE4E/blog/" title="blog or email this clip"><img src="http://content7.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK