unique string

Vu Pham vu at sivell.com
Mon Dec 21 12:03:29 PST 2009


On 12/21/2009 12:12 PM, The Small Box Admin wrote:
> Depending on use, I just use the "date" command.
>
> On Mon, Dec 21, 2009 at 8:15 AM, Vu Pham<vu at sivell.com>  wrote:
>> To generate a temporary and unique directory name, I use uuidgen for the
>> unique string, something like tempdir=`uuidgen`;mkdir
>> /tmp/$tempdir;...;rmdir -r -f /tmp/$tempdir.
>>
>>

Thanks. Yes, I did use date too, with `date +%s%N`, but there is a small 
possibility that the script is invoked at (almost) the same time so I 
switched to uuidgen.

Vu



More information about the Linux-users mailing list