preprocess environment variables

Signed-off-by: Simon Leung <leungs@us.ibm.com>