mktemp -d not creating temp directory

336 views Asked by At

I am trying to create a temporary directory using mktemp -d but it is not creating a directory. When I try to run cd $(mktemp -d) it takes me to my home folder. This behavior is similar to cd .

When I try to run mktemp -d and check the exit code using echo $? it return 248 as the exit code.

What is going on?

1

There are 1 answers

0
Dan Bonachea On

Most likely $(TMPDIR) is set to a non-existent directory or one to which your user lacks write+execute permissions.