help-tar
[Top][All Lists]
Advanced

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

Re: [Help-tar] tar list of dirs from STDIN - *just the dirs* (to save pe


From: help-tar
Subject: Re: [Help-tar] tar list of dirs from STDIN - *just the dirs* (to save perms)
Date: Wed, 29 Nov 2017 06:04:54 -0600

Thanks Sergey!

On Wed 11/29/17 11:26 +0200 Sergey Poznyakoff wrote:
> >     $ echo ~/.config/ | tar -cvf /dev/null -T - --no-recursion 2>&1 |head -4
> 
> The '--no-recursion' option modifies the behavior of options and
> arguments that follow it. The way you use it it has no effect. The
> correct way:
> 
>       $ echo ~/.config/ | tar -cvf /dev/null --no-recursion -T - 2>&1 |head -4
> 
> For details, please see the GNU tar manual, subsection 3.4.4
> "Position-Sensitive Options".

Thanks for the reference.

--
Based on what you say, appears this section of the tar texinfo manual
is incorrect, since "--no-recursion" has nothing following it:

    6.9 Descending into Directories
    --snip
    Specifying '--no-recursion' is a way to tell 'tar' to grab only the 
directory
    entries given to it, adding no new files on its own.  To summarize, if
    you use 'find' to create a list of files to be stored in an archive, use
    it as follows:
         
         $ find DIR TESTS | \
           tar -cf ARCHIVE -T - --no-recursion

--
regards,
Tom
--

Yes it works!:

    $ echo ~/.config/ | tar -cvf /dev/null --no-recursion -T - 
    tar: Removing leading `/' from member names
    /a/myself/.config/
    $




reply via email to

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