fix detection of whitespaces in source path, use POSIX shell instead of Bash