use bash instead of source to make basename work