convert this function from bash to dash

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>