work around a bug in bash3, now tested with dash, bash, busybox