Skip to content

Instantly share code, notes, and snippets.

@SamRothCA
Created November 28, 2014 17:05
Show Gist options
  • Save SamRothCA/ae1541b61bf777a5918f to your computer and use it in GitHub Desktop.
Save SamRothCA/ae1541b61bf777a5918f to your computer and use it in GitHub Desktop.
Calendar for current month
cal | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
@pi1ot
Copy link

pi1ot commented Dec 20, 2014

cal | grep --before-context 6 --after-context 6 --color -e " $(date +%e) " -e "^$(date +%e)" -e "$(date +%e)$"

@jorgeyp
Copy link

jorgeyp commented Jan 19, 2015

What is the difference @pi1ot ?

@5amfung
Copy link

5amfung commented Apr 12, 2015

@pi1ot I got segfault.

@sheroze1123
Copy link

This wouldn't work when the date number shows up in the year number. (e.g. 20th April, 2015) This works better. Also, change the shell to be /bin/bash if you're using an alternate shell.

cal | head -n 1; cal | tail -n +2 | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment