MJ Ray mjr@dsl.pipex.com wrote:
For rc: cd /var/www && tar cvf - --files-from <{find . -name '*.html'} | tar xfC - /new/directory
I think bash is the same, but uses () instead of {}
What's going on there? Well, the cd should be obvious. If that succeeds (&&), run tar to Create Verbosely a File (cvf) and that file goes to standard output (-). Tar should read filenames from a file (--files-from) which is actually the output of that find command (that's what the <{...} does, turning command output into a file (really a type of pipe)). Then we send that (|) to another tar command that eXtracts a File (xf) from standard input (-), Changing directory (C) to /new/directory before writing files.
It's like a foreign language sometimes...
What do you mean - somtimes?
I haven't tried it yet but I'll give it a go.
I could never, in a month of Sundays, dream up something like that :-)
Thanks Mark.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain