[Toybox] Tar --transform is weird.

Rob Landley rob at landley.net
Sat May 21 08:29:10 PDT 2022


I don't have a xenial iso lying around but I just tried it on "focal fossa", and
it failed exactly the same way.

Presumably because s,regexp/replace/flags does not use the same separator all
the way through, a sed expression with s,one,two,flags could work, but that's
not what you said nor what I did in the cut and pastes? (Nor would it be likely
to change how the flags were interpreted. I was trying s at one@two at flags in a lot
of my tests because I was matching against multiple path segments to see if that
worked, which it did...)

I.E. I know WHY it doesn't work, and if you're going to continue to insisting
that it DOES work, could you cut and paste an example like I've been doing
please? You run this, you get this.

Also "they have been told, and the easy fix"... who told them? It can mess up
how? (Example and explanation of example?) What specifically was the "easy fix"?
Was this on a mailing list? Is there a web archive link to the conversation?

Rob

On 5/21/22 00:36, scsijon wrote:
> did to check and does, xenial64 ??
>
> On 21/5/22 13:55, Rob Landley wrote:
>> On 5/20/22 18:02, scsijon wrote:
>>> On 21/5/22 00:05, Rob Landley wrote:
>>>> On 5/19/22 18:55, scsijon wrote:
>>>>> https://www.gnu.org/software/tar/manual/html_section/transform.html#transform
>>>>> is the refreance page for this. Look about halfway down for 's' and 'S'.
>>>> I did:
>>>>
>>>> The expression is a sed-like replace expression of the form:
>>>> s/regexp/replace/[flags]
>>> try
>>>
>>> s,regexp/replace/[flags]
>> $ tar c one --xform s,three/zero/ | tar t
>> tar: Invalid transform expression
>>
>>> it should use sed correctly then, the problem is that transform
>>> looks for it's flags first and can 'mess-up'. they have been told,
>>> and the easy fix, but ignored the email.
>> You could to test your suggestions against the tar on your own system. Just a
>> thought.
>>
>> Rob



More information about the Toybox mailing list