viq on Nostr: is your friend. And there becomes a point where doing something in bash becomes ...
https://www.shellcheck.net/ is your friend. And there becomes a point where doing something in bash becomes painful, and it's time to jump to python or perl or something like that.