POSIX Shell - function returns string