inmproved loadenv.sh for customisation inside scripts