[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash parameter expansion (remove largest trailing match, remove larg

From: Robert Elz
Subject: Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work
Date: Sun, 30 Aug 2020 16:00:46 +0700

    Date:        Sat, 29 Aug 2020 22:08:14 -0400
    From:        Bruce Lilly <bruce.lilly@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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]