Shell Script To Create Files and Directories That Do Not Exist

in Categories Academic, Decision Making, File-management last updated February 19, 2009

Share this on:

5 comment

  1. Yeah, this script isn’t multi-process safe. Is there any other way, which is multiprocess safe as well?

  2. This script isn’t multi-process safe.
    Test it by calling the same process with same file names multiple times in a wrapper script. ‘touch’ only changes last modification time, couldn’t tell you if a file is already been created.

  3. michael: u can run this script by below.

    shell> chmod +x script_name
    shell> ./script_name

    above is one way of running the script where script_name is the name you give to the shellscript you saved.

    you can also run it as below;
    shell> sh script_name

    Have a question? Post it on our forum!