Unique temporary file names in Korn shell without much fuss

If you are worried that multiple instances of one of your scripts will step on each other’s temporary file names, just use $$ as part of the name for uniqueness:

lspv > $$.lspv.out

[ DO STUFF WITH $$.lspv.out, its actual name is 660676.lspv.out with 660676 being your process id ]

rm $$.lspv.out

Leave a Reply

Your email address will not be published. Required fields are marked *