You seem to have changed completely your strategy here. It's a bit confusing because of the timespan between responses and because youre doing multiple code iteration within a pull request. 

Anyway, here I find that exporting is a bit... well, it leaves traces. 

I found a nice way to deal with returning values from function, which goes as following

```bash
local resultvar=$1;
local ret;
shift;

...

eval $resultvar="'$ret'"
```

This allows for better control of where information should be returned, and does not contaminate the environment the application is running in.

Example: https://github.com/Wizcorp/libbash/blob/master/query.sh