Created
December 5, 2010 00:44
-
-
Save jtrim/728644 to your computer and use it in GitHub Desktop.
Shell script that uses ruby to get a humanized version of a long date string. Copies to your clipboard and echoes to the command line. NOTE: Uses pbcopy to copy to the clipboard, which is only available on OSX. From terminal, run "dayahead 0" to get today
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dayahead() { | |
| DAYSTRING=`ruby -e "require \"time\"; require \"date\"; puts Time.parse((Date.today + $1).to_s).strftime(\"%A, %B %d, %Y\")"` | |
| echo -n $DAYSTRING | pbcopy | |
| echo $DAYSTRING | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment