≡ Menu

Shell script to generate random files using RANDOM variable

{ 3 comments… add one }
  • doukremt January 19, 2013, 10:11 pm

    Not testing if the file to be created already exists is a rather bad idea

  • guy May 19, 2009, 8:17 am

    or both… /tmp/$(basename $0).$RANDOM.$$.txt

    say hello to the safe side


  • Nerf June 18, 2008, 1:40 pm

    This is bad practice. A much better way would be to use $$, which is the process ID. In the loop above I would create a filename of “/tmp/$(basename $0).$$.txt”

Security: Are you a robot or human?

Leave a Comment