diff options
author | Ben Sima <ben@bsima.me> | 2022-11-15 09:50:31 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-11-15 09:50:31 -0500 |
commit | 3f9ad400be3988244586cfae0c2181181b18c41d (patch) | |
tree | 419aea0a80d1a80525069ccfc87e9eda001bd558 /hledger-allocation | |
parent | d3a4bf44df7801af48f2784a749b230a67dc264e (diff) |
moved hledger scripts to ~/fund repo
Diffstat (limited to 'hledger-allocation')
-rwxr-xr-x | hledger-allocation | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/hledger-allocation b/hledger-allocation deleted file mode 100755 index 077e1b8..0000000 --- a/hledger-allocation +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -function cleanup() { - tail -n1 $1 | tr -d [:alpha:] | tr -d [:blank:] | tr -d [=,=] -} - -networth=$(hledger bal ^as ^li --value=now,USD --auto --output-format=csv \ - | tail -n1 \ - | tr -d [totalUSD,\"]) - -#commodities=$(hledger commodities) -commodities=("BTC|sat|SAT|GBTC" GROQ USD ETH BCH LTC XLM) - -printf "networth: %.2f USD\n\n" $networth - -for com in ${commodities[@]} -do - n=$(hledger bal ^as ^li cur:"$com" --value=now,USD | cleanup) - pct=$(bc -l <<< "$n/$networth*100") - printf "%s: %.1f%%\n" $com $pct -done |