Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Bruce Lilly Newsgroups: gnu.bash.bug Subject: Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work Date: Sat, 29 Aug 2020 22:08:14 -0400 Lines: 10 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1598753336 13981 209.51.188.17 (30 Aug 2020 02:08:56 GMT) X-Complaints-To: action@cs.stanford.edu Cc: Koichi Murase , bug-bash@gnu.org To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=fOpWGee3NwPgQaQlILndUUHnaXBWKGZNmLa6INfvd2k=; b=YJ2VsLqBJSQTqO1e5ftvxg3SAh1aHlyRXtmXfKHBqBixJ//17dk+5yYGEqhRXg6N/7 xA4X0bognlsNS+IHeMRKxThszR+YLUHtKTC+wCzp3XV2ZR8jvfGhRvL0S3J0E5yDAB++ lRUeE1nhiQNetNZLbz2v7JYzhPo6IFACa7gnHLQsfK9cBN1868hINOEF4xHMZhu3EPoP 70+QMyW8zoQP46rb/aUc3RgG1N8hPlldTjzW09SK5U2gUfQbLZ28W/ZWc/obfP3XPLhv 0tOTLivudR/cc1k+ylL7UCGeFAnbZDyw54HQGOjuPCwUbDQ7X/WfgSdT4KrGIqMACrLj zrHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=fOpWGee3NwPgQaQlILndUUHnaXBWKGZNmLa6INfvd2k=; b=amzuJE8wf7rMJpZO+VY7n9tC6CZGRs/XEN489N3AIVfwN5TEnuKuqLQW6tNqgrVWUz gEJ1TixOnMhcEzsVFiNikCFfO3y+doTIDVutqcJK+Ve1Gfv1V+bOc4/feOw+imbOsScp lxL/UNgA566otFiV7if/lKI44dPR6sjRWrdtLrWgFxapfdqy0EWA30Qmx7MBzYHNIqrc 6+r5u9cpj+nnuSPQLoreUpS10TMlS9XHBy2aPUN/phjVqZ6k7jkrNFy8c/M/cKsH+xkC BJdXD2gbEloao19EhHG8lx44VsFoGZ0MaM1OoYZNlyV2FvqCDRvxMdpWqbgtCwmpzR/C TdnA== X-Gm-Message-State: AOAM5313k4S40uMcFSe35er6jltxltJ9cbQkVC3LOhsNwqtrXZs535px nYie/ThFC4sRYhuGt7oK/76ZX2nHCHUWo6tghS4= X-Google-Smtp-Source: ABdhPJzOiSlITqvb7IWwG9kASNBK6VE7zxRmRzeE8mwd1HY1Y+9gewwGIBDvE3MmXN+0T9aLr5xzEwsQmEDMzoRUPHI= X-Received: by 2002:a5e:c309:: with SMTP id a9mr4227433iok.105.1598753332402; Sat, 29 Aug 2020 19:08:52 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d32; envelope-from=bruce.lilly@gmail.com; helo=mail-io1-xd32.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:16862 On Sat, Aug 29, 2020 at 9:12 PM Lawrence Vel=C3=A1zquez wrot= e: > (a) $'...' is not POSIX. For instance, dash does not recognize it. dash also doesn't have adequate pattern matching for the example task (building a path while ensuring no empty components); it has no way to specify one-or-more (or zero-or-more) occurrences of a pattern such as a slash.