Re: cp improvement
[email protected] (Bob Proulx) Thu, 3 Apr 2003 09:47:09 -0700
| Newsgroups | gmane.comp.gnu.fileutils.bugs |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > I think I have a good idea to improve the functionality of cp > command. Sometimes I and my colleagues ( UNIX admins ) have to copy > of directory structure. Just the directory structure? Not the files in it? > find <dir> -type d -print | (cd <new dir>; awk '{ print "mkdir "$1}' | > sh -x) Alfred M. Szmidt wrote: > No, since the GNU GPL prohibits you from doing any changes, looking at > the source code, distributing those changes... Whoops, wrong world! > Yes you can do those changes since it is Free Software. :-) > But doesn't "cp -a" do what you want to-do, or even "cp -R"? 'cp -a' is my best friend. But if the OP wanted just the directories then I think the find|awk was pretty good. But I think I can improve it using xargs. find . -type d -print0 | (cd new_dir ; xargs -0i mkdir -p {}) I just can't see that being a very common activity. Bob