]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Add trailing letter b to bsdtar substitute pattern (#2012)
authorgrembo <freebsd@grem.de>
Mon, 11 Dec 2023 05:51:13 +0000 (06:51 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 05:51:13 +0000 (21:51 -0800)
commit0f410f8cfb512f1c7e36f01bd141f2e929281c26
tree4835a6ea6d8fd256880e675ad5c76360bf532353
parent2f4f9a7e4fd6fc7cafd4519e1c90bcc1851d0a2e
Add trailing letter b to bsdtar substitute pattern (#2012)

The letter b stands for "from (b)eginning" and specifies that a
substitute expression should be matched from the beginning of the
string, regardless if and where a previous substitute expression
matched.

Example:
Transform filename from B-A to A-B and remove all underscores.

Attempt without option b:

    bsdtar -cft -s '/\(.*\)-\(.*\)/\2-\1/gp' -s "/_//g" ab_c-d_ef
    ab_c-d_ef >> d_ef-ab_c

With option b:

    bsdtar -cft -s '/\(.*\)-\(.*\)/\2-\1/gp' -s "/_//gb" ab_c-d_ef
    ab_c-d_ef >> def-abc
tar/bsdtar.1
tar/subst.c
tar/test/test_option_s.c