I'm looking for a way to accomplish this in a single statement:
./perlscript.pl ./inputFile "some option" > temp.sh; source temp.sh; rm -f temp.sh
temp.sh does
export ENV_VAR="some value"
and after the above commands echo $ENV_VAR reports some value.
I've tried
./perlscript.pl ./inputFile "some option" | source /dev/stdin
and the script runs, but the source doesn't seem to have worked; echo $ENV_VAR shows nothing. I feel like this is very close, but I've run out of ideas.
Any ideas?
sourceis basically "read a file and eval it"; how abouteval "$(perl etc)"