I've tried various variations of the below code, none of them seems to work
def runScript(command){
sh '''#!/bin/bash
file="env.txt"
while IFS='=' read -r key value
do
export ${key}="${value}"
done < "$file"
pwd
"${command}"
'''
}
command
is the dynamic shell command that I want to execute after re-creating the environment variables from env.txt
Any idea ?