bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Add description option


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] Add description option
Date: Mon, 13 Jun 2011 19:44:05 +0300

dime cyborgian <address@hidden> ha escrit:

>     Is there a option using which I can just add a description about a
>    archive

Yes, there is.

>    in a file say description.txt and it should be viewable when I
>    use a syntax
>    cat description.txt
>    This tar is created for test purpose.
>    tar -czvf test.tar.gz mydir
>    for example:
>    tar --view-desc test.tar.gz
>     This tar is created for test purpose.

Try --label/--test-label:

1. Creating archive:

$ tar -czvf test.tar.gz --label="`cat description.txt`" mydir

2. Testing the rchive:

$ tar -tf test.tar.gz
This tar is created for test purpose.
[..archive listing follows..]

3. Viewing the label:

$ tar --test-label -f test.tar.gz
This tar is created for test purpose.

4. Checking whether the label matches given text:

if tar --test-label \
   -f test.tar.gz 'This tar is created for test purpose.'; then
   ...
fi

The --test-label option appeared in tar 1.24. You will get more info
on it in the GNU tar Manual, section 9.7 "Including a Label in the
Archive" (an online copy is available at
http://www.gnu.org/software/tar/manual).

Hope that helps.

Regards,
Sergey




reply via email to

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