From 3f9ad400be3988244586cfae0c2181181b18c41d Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 15 Nov 2022 09:50:31 -0500 Subject: moved hledger scripts to ~/fund repo --- hledger-allocation | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100755 hledger-allocation (limited to 'hledger-allocation') 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 -- cgit v1.2.3