Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16864 > unrolled thread

Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

Started byRobert Elz <kre@munnari.OZ.AU>
First post2020-08-30 16:00 +0700
Last post2020-08-30 16:00 +0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work Robert Elz <kre@munnari.OZ.AU> - 2020-08-30 16:00 +0700

#16864 — Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

FromRobert Elz <kre@munnari.OZ.AU>
Date2020-08-30 16:00 +0700
SubjectRe: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work
Message-ID<mailman.1758.1598778080.2469.bug-bash@gnu.org>
    Date:        Sat, 29 Aug 2020 22:08:14 -0400
    From:        Bruce Lilly <bruce.lilly@gmail.com>
    Message-ID:  <CAPyES35Ca6yUirzYX71n+9TOcs6f_Ur5sSGT-D39nQ5bzK_jiw@mail.gmail.com>

  | 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.

It does, you just don't get to do it in one absurdly complex variable
expansion.   There is very little that can't be done in sh that is
reasonable to attempt in sh code (floating point matrix inversions are
probably not a candidate for example) - including even the original
7th edition Bourne sh (with no functions, nothing builtin, bugs all over
the place, ...)   Sometimes it takes a bunch of code, and sometimes it
might not be extremely fast, but it is possible.

kre

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web