From Mike Sanders@mike@porkchop.bsd to comp.lang.awk on Thu Jun 25 20:59:33 2026
From Newsgroup: comp.lang.awk
just trying to keep the script more or less
perpetually updated (only tested with gemini).
calculating mean weighted yield, works well on my end...
#!/bin/sh
<<PROMPT
1/3 replace YIELD values with latest forward yields for each ETF
2/3 emit ONLY the entire updated script in a codeblock
3/3 absolutely no extra chatter
PROMPT
awk '
/^ETF/ { e=1; next }
e { s += $2 * $3; w += $2 }
END { printf "Mean Weighted Yield: %.2f%%\n", s / w }' "$0"
exit