Add bashisms to workspace related functions

I believe these changes are related to shellshock. I always found the
previous behaviour a bit strange so I guess it's all good.