[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] how to change absolute paths in tar
From: |
Joerg Schilling |
Subject: |
Re: [Bug-tar] how to change absolute paths in tar |
Date: |
Tue, 19 Apr 2005 14:40:20 +0200 |
User-agent: |
nail 11.2 8/15/04 |
"address@hidden" <address@hidden> wrote:
> I need to create a tarfile that will be untarred using
> tar's P option (absolute paths), but the absolute
> directory that I archiving is not the same as the
> absolute directory I want tar to extract into.
>
> For example, I want to archive /home/dir1/dir2, but
> have it extract into /home/dir2.
>
> I can't use relative paths because the users' already
> have the script that contains the tar extract command
> (tar xvzpPf...)
I am not sure what you like to do but you could use star's
s=replstr Apply ed like pattern substitution -s /old/new/gp on filenames
option to automatically modify the filenames.
Up to 100 patterns are supported.
BTW: tar has no -P option.
star implements -P to write partial last records (since 1986)
Sun tar implements -P to prevent adding a slash ("/") to directory names.
Maybe you were speaking about gtar?
Jörg
--
EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
address@hidden (uni)
address@hidden (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily