I'm trying to run a script and bash export is outputting text when I don't want it to because it's breaking up the output. I need to run a script which extracts some information and then inserts it into the next commands environment, kind of like acquiring the AWS secrets for the awscli and transparently passing them into the aws environment. I'm getting inconsistent results and I'm unsure why
$ ./bin/aws-creds mock
AWS_ACCESS_KEY_ID=mock1234
AWS_SECRET_ACCESS_KEY=mock1234
AWS_CREDS=success
$ ddt aws-creds mock
AWS_ACCESS_KEY_ID=mock1234
AWS_SECRET_ACCESS_KEY=mock1234
AWS_CREDS=success
Both output equally, which is great, so lets try to run them and use export on the output
$ export $(./bin/aws-creds mock)
$ export $(ddt aws-creds mock)
AWS_ACCESS_KEY_ID=mock1234
AWS_SECRET_ACCESS_KEY=mock1234
AWS_CREDS=success
declare -x .... a bunch of extra things from my environment
Wait a second? Both commands, when put into export using a subshell $(...) seem to do different things and this is what I want to fix. I want like the first ./bin script, no output, but all the new parameters inserted into the shells environment. It seems like the script I wrote 'ddt', doesn't work the same way for some reason.
Can anybody explain why and maybe suggest some way to fix it?