This question already has an answer here:
- Different ways to execute a shell script 8 answers
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:
then my terminal will just exit "process completed", even if I use
set +e, it still exits.
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.