Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- case $# in
- 0) month=$(date +%m) year=$(date +%Y);;
- 2) month=$1 year=$2;;
- *) echo 1>&2 "Usage: $0 [MONTH YEAR]"; exit 3;;
- esac
- month=${month#"${month%%[!0]*}"};
- if ((month == 1)); then
- previous_month=12 previous_year=$((year-1))
- else
- previous_month=$((month-1)) previous_year=$year
- fi
- if ((month == 12)); then
- next_month=1 next_year=$((year+1))
- else
- next_month=$((month+1)) next_year=$year
- fi
- paste <(cal $previous_month $previous_year)
- paste <(cal $month $year) | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
- paste <(cal $next_month $next_year)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement