I create a temporary directory in a.sh TEMP_DIR=$(mktemp -d)
, and I would like to access this temporary directory from b.sh.
I have already tried exporting(Can I export a variable to the environment from a bash script without sourcing it?) and sourcing the path to this directory, but they are not useful for my case, because the two scripts are separated from each other by several commands and I cannot directly run b.sh from a.sh.
How can I achieve this?