- #!/usr/bin/zsh
- # determine start and end years
- startyear=$1
- endyear=$2
- cd ${LEDGER_DIRECTORY}
- cp ${LEDGER_FILE_NAME} ${LEDGER_FILE_NAME}.bak
- ledger -b ${startyear} -e ${endyear} print > ${LEDGER_FILE_NAME}-${startyear}.dat
- ledger equity assets > equity.tmp
- ledger -b ${endyear} print > ledger.tmp
- cat template.dat equity.tmp ledger.tmp > ${LEDGER_FILE_NAME}
- rm -r equity.tmp ledger.tmp
|