bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6925: strange behavior of mktemp (GNU coreutils) 7.4, Ubuntu 10.04)


From: master atomknuseren
Subject: bug#6925: strange behavior of mktemp (GNU coreutils) 7.4, Ubuntu 10.04)
Date: Fri, 27 Aug 2010 15:08:05 +0200

When I invoke mktemp in a script as:

#!/bin/bash
DIR=$( mktemp||exit 1 )
cd $DIR
echo $?

I receive an error like:
--
can't cd to /tmp/tmp.68rHO2a3jc
2
--
>From a bash-shell I can cd into the temporary dir. But if I in the
bash-shell write
mkdir -p /tmp/tmp.68rHO2a3jc
I get the error:
mkdir: cannot create directory `/tmp/tmp.UrC5wV58SC': File exists
despite of the -p flag.

My primitive workaround is to recreate  $DIR as in:
#!/bin/bash
DIR=$( mktemp||exit 1 )
rm -r -f $DIR
mkdir -p $DIR
cd $DIR
echo $?


And in this case the "mkdir -p" recreation, from a bash-shell, does not give
any errors


reply via email to

[Prev in Thread] Current Thread [Next in Thread]