#!/bin/sh # # Usage: didwhat [day] # # Display what you've done in a given day. Specifying which day is done by piping directly into # date's -d option, so you can do things like "yesterday" and "3 days ago". Default is "today" # # Modified from something found on Hacker News some time ago FILE=~/.did if [ "$1" != "" ]; then SEARCH=$(date -d"$1" +"%a %d %b %Y") else SEARCH=$(date +"%a %d %b %Y") fi echo "Search: $SEARCH\n" >&2 cat $FILE | grep --color=never "$SEARCH"