Generate a random filename in unix shell

前端 未结 14 678
说谎
说谎 2020-12-22 23:39

I would like to generate a random filename in unix shell (say tcshell). The filename should consist of random 32 hex letters, e.g.:

c7fdfc8f409c548a10a0a89a7         


        
14条回答
  •  独厮守ぢ
    2020-12-23 00:19

    why do not use unix mktemp command:

    $ TMPFILE=`mktemp tmp.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` &&  echo $TMPFILE
    tmp.MnxEsPDsNUjrzDIiPhnWZKmlAXAO8983
    

提交回复
热议问题