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?
Most likely
$(TMPDIR)is set to a non-existent directory or one to which your user lacks write+execute permissions.