NetBSD-Bugs archive

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

Re: bin/55613: /bin/sh does not support ksh extended patterns



The following reply was made to PR bin/55613; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: Martin Husemann <martin%duskware.de@localhost>
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: bin/55613: /bin/sh does not support ksh extended patterns
Date: Sat, 29 Aug 2020 23:30:45 +0700

     Date:        Sat, 29 Aug 2020 09:03:29 +0200
     From:        Martin Husemann <martin%duskware.de@localhost>
     Message-ID:  <20200829070329.GA19232%mail.duskware.de@localhost>
 
   | The +( ... ) patterns are ksh specific extensions and AFAICT not covered
   | by Posix - but I may be reading that wrong. Robert, what do you think?
 
 That is definitely non-standard, the patterns are standard glob
 patterns, where the only magic chars are ? * and [] (and then ! inside [])
 (that doesn't count quoting, which can turn the magic chars into normal ones).
 
 Various shells have made different extensions to glob patterns, for
 all kinds of reasons - in particular limited circumstances some of
 them have some minor merit, but in general, not enough to bother with
 (if you want ksh or bash, run them).
 
 The ksh syntax is particularly problematic, it invents new magic chars,
 potentially making some valid patterns now mean something different.
 Extensions to glob need to be done by taking something which is meaningless
 in a glob pattern (like "**") and giving that a meaning (it can be used
 as an introducer for some other new syntax if needed).  There aren't many
 such sequences however.
 
 kre
 


Home | Main Index | Thread Index | Old Index