The dir environement variable is correctly set
Are you sure?
from the code, the dir environment variable is:
"dir=testUnix"

yet all you other paths are not in '/' (root).
All the rest of the output matches what ever you gave in your code...