bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp improvement


From: Bob Proulx
Subject: Re: cp improvement
Date: Thu, 3 Apr 2003 09:47:09 -0700
User-agent: Mutt/1.3.28i

address@hidden 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]