OFF TOPIC: directory tree script file problem

Bob Shaffer fedora at bobshafferscomputer.com
Wed May 5 15:33:29 UTC 2004


duncan brown said:
>
> Mick Mearns said:
>> What I want to do is scan a directory structure and re-create it
>> without any files.
>
> cd /source_dir
> find . -type d | while read line
> do
>   mkdir -p /target_dir/${line}
It might be a good idea to quote this, like this:
   mkdir -p "/target_dir/${line}"
That way if any directories have spaces in them, you'll still be okay.
> done
>



____________________________________________________________________________
Bob Shaffer II - Owner/Developer/System Operator - BobShaffersComputer.com
http://bobshafferscomputer.com/          telnet://bobshafferscomputer.com





More information about the fedora-list mailing list