The quotes and the `basename` call I can understand, but what's the point of `$PWD` here? If you don't provide a full path, it's going to output to the current directory anyway.

Also, two styles of command substitution on the same line - yuck.