diff --git a/bin/bashrc b/bin/bashrc index d79b97f85..fb63a912f 100755 --- a/bin/bashrc +++ b/bin/bashrc @@ -68,12 +68,12 @@ hledgerfiles() { ls $@ *.{journal,j,timelog,csv,ledger,lgr,dat} 2>/dev/null } -# helpers for working with yearly files +# helpers for working with yearly files. -FIRSTYEAR=2006 - -# yearfiles [N] - print the paths of all or the last N yearly journals +# yearfiles [N] - print the paths of all or the last N yearly journals. +# Adjust to suit your files. yearfiles() { + FIRSTYEAR=2006 N="$1"; shift YEAR=$(date +%Y) if [[ -n "$N" ]]; then @@ -106,6 +106,11 @@ years() { hledger $(yearopts "$N" | xargs) "$@" } +alias 10y='years 10' +alias 9y='years 9' +alias 5y='years 5' +alias 2y='years 2' + # eachyear [N] [n|p|P] "SHELLCMD" - run SHELLCMD with $LEDGER_FILE set, # for each or just the last N yearly journals, # optionally printing the file name with 0, 1 or 2 line breaks.