bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Changing file name when adding in to an archive.


From: Tim Kientzle
Subject: Re: [Bug-tar] Changing file name when adding in to an archive.
Date: Fri, 21 Aug 2009 08:42:18 -0700
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16

Nikolay Shaplov wrote:
I've met a lack of functionality in tar, I really need. In short I need
a possibility to add file file1 to a tar archive, but using name file2.
I did not find a way to do it without renaming file on real fs... or at
least it was not mention in the manuals I've read.

GNU tar's --xform option looks like it would do what you want:

$ find dir1
dir1
dir1/a
$ gtar-1.22 cf - --xform='s|dir1/a|foozle/q|' dir1 | tar tvf -
drwxr-xr-x  0 tim    tim         0 Aug  4 21:36 dir1/
-rw-r--r--  0 tim    tim         0 Aug  4 21:35 foozle/q


Cheers,

Tim




reply via email to

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