Creation of unique filename for temp file.

Creation of unique filename for temp file.

Post by Shaun Palme » Wed, 24 Feb 1999 04:00:00



We are migrating shell scripts from HP-UX to Sun Solaris, and have run into
a problem.
Under HP-UX there is a command to generate a unique file name  - mktemp.
This command does not seem to be available under Solaris.  Is there an
equivalent?
 
 
 

Creation of unique filename for temp file.

Post by H-C-I Administratio » Wed, 24 Feb 1999 04:00:00


Hi Shaun

Try using the pid for the process e.g. filename.$$ from your shell script.

Also, if you are using ksh you can use filename.$RANDOM.

Regards

Sean


>We are migrating shell scripts from HP-UX to Sun Solaris, and have run into
>a problem.
>Under HP-UX there is a command to generate a unique file name  - mktemp.
>This command does not seem to be available under Solaris.  Is there an
>equivalent?