• hybrid = script + data + ai prompt

    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

    ETF WEIGHT YIELD
    QQQI 76.06 14.36
    MLPI 9.99 14.54
    SPYI 7.96 12.20
    EGGY 3.36 29.38
    CHPY 1.77 48.92
    --
    Mike Sanders
    :wq
    --- Synchronet 3.22a-Linux NewsLink 1.2