Source functions from variable

so i found a way to do this.

#!/bin/bash
MYF=$(/home/jason/myfunctions)
source <(printf '%s\n' "${MYF}")
echo "${var1}"

/home/jason/myfunctions is a script that outputs information..i.e. functions...etc that needs to be sourced. I have no control over /home/jason/myfunctions. i can only run it.

the above works for me. as im able to source the output of the myfunctions script. however, the above solution is not portable. it only seems to work on newer versions of bash.

can anyone look at the above solution and come up with a modified version of it that will work everywhere on all unix systems?

What keeps you from sourcing myfunctions immediately?

Nothing really. But that still isn't portable :frowning:

Are you building rube goldbergian code mutators again?