> I have a command which outputs to STDOUT a bunch of absolute paths to
> some files of interest:
> I would like to tar all of these files up, but have them untar in
> relative fashion. ie,
Hmmm. If they're really all under the same tree all nice like
that, you should be able to something like this:
tar -cf file.tar `(command) |cut -c2- |xargs`
The 'cut -c2-' gets rid of the leading slash, the 'xargs' with no
arguments sticks 'em all onto one line.
If they're *not* all under the same tree, or you need the tree to
be different - say, for example, you've got:
and you want to have them both untar in:
Then you get into doing something like:
tar -cf /u03/staging3/file.tar -C /u01/staging1 `(command) |xargs`
tar -rf /u03/staging3/file.tar -C /u02/staging2 `(command) |xargs`
where 'command' in this case outputs filenames with a relative
path, based on the path passed with the -C flag.
Hope this is vaguely helpful.
This address expires. Take out the hostname if your reply bounces.
Read http://dan.scream.org/pay4spam.html before you send ads to me.
This address may not be distributed unless this notice is included.
Visit http://dbirchall.epinions.com/user-dbirchall for my opinions.