Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > gnu.bash.bug > #16864
| From | Robert Elz <kre@munnari.OZ.AU> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work |
| Date | 2020-08-30 16:00 +0700 |
| Message-ID | <mailman.1758.1598778080.2469.bug-bash@gnu.org> (permalink) |
| References | (5 earlier) <CAPyES37OZ-TAjmxRp72dv97eKPzNes=__QqnBHuEK+rK78QSSg@mail.gmail.com> <CAFLRLk-WondkFshbc5=vF=20dViDyn20E7eps3rMJaog4ag7Yg@mail.gmail.com> <CAPyES34iHv0YzEjQd1me3qV2JrZ=XOgvR_Wb5SpZ=5cYWQ3-vQ@mail.gmail.com> <C4224EEC-8FBF-472A-88DF-B96BA3F1A8CB@larryv.me> <26506.1598778046@jinx.noi.kre.to> |
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
Back to gnu.bash.bug | Previous | Next | Find similar
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
csiph-web