I want to create a bash script or something similar that I can execute in the current shell:
echo '#!/bin/bash
export foo="bar" ' > zoom.sh
but if I want to run this script in the current process:
exec ./zoom.sh
then my terminal will just exit "process completed", even if I use set +e, it still exits.
There's source and eval which will run stuff in the current shell, so maybe eval is my best bet? A bash function will work - but I have to rely on the user to source it in the first place.