;bin: bashrc: updates
This commit is contained in:
parent
7e684116f2
commit
d6b905fa08
13
bin/bashrc
13
bin/bashrc
@ -68,12 +68,12 @@ hledgerfiles() {
|
|||||||
ls $@ *.{journal,j,timelog,csv,ledger,lgr,dat} 2>/dev/null
|
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.
|
||||||
|
# Adjust to suit your files.
|
||||||
# yearfiles [N] - print the paths of all or the last N yearly journals
|
|
||||||
yearfiles() {
|
yearfiles() {
|
||||||
|
FIRSTYEAR=2006
|
||||||
N="$1"; shift
|
N="$1"; shift
|
||||||
YEAR=$(date +%Y)
|
YEAR=$(date +%Y)
|
||||||
if [[ -n "$N" ]]; then
|
if [[ -n "$N" ]]; then
|
||||||
@ -106,6 +106,11 @@ years() {
|
|||||||
hledger $(yearopts "$N" | xargs) "$@"
|
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,
|
# eachyear [N] [n|p|P] "SHELLCMD" - run SHELLCMD with $LEDGER_FILE set,
|
||||||
# for each or just the last N yearly journals,
|
# for each or just the last N yearly journals,
|
||||||
# optionally printing the file name with 0, 1 or 2 line breaks.
|
# optionally printing the file name with 0, 1 or 2 line breaks.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user