bash: avoid excessive export of variables