Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= 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 21:12:35 -0400 Lines: 38 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1598749964 12227 209.51.188.17 (30 Aug 2020 01:12:44 GMT) X-Complaints-To: action@cs.stanford.edu Cc: Koichi Murase , bug-bash@gnu.org To: Bruce Lilly Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=larryv.me; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=w isT/W8ZvhF0txmiEz4EvherbA0zQSwdUc59VjpDHdQ=; b=I04leCLW43e3LVT8x W/+pMPsNPfN9PU/MHTvEvAXDZsmtxDVPCVeQ+6VM2zhkXTyZU0pCvlIjACmMtK6w vU2cUkfVntGE3t2T420Ya20y3QXjPLizFmScKkWMDvqw1jmboipG9u4vpVUfJKtp 2lOJE9WlIRXVL/F1rhGlDr7FT8LSwbrgR1IQDbwQIwUkmjMKjMxOYNgi/Tc8bn6J jLkNfnMUq9e+Z5j5V8YWz7hxIeOiZ1BG61xJOdKUfZ9Ooh29uuo+Bbhe2NxAajKO msVAu2sCfWPsPHveAzwLA2SI+oGkaYmEspz7dVqgRTBPUv6vZ8zh2ITSJYnL1/uL Pi2vw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=wisT/W8ZvhF0txmiEz4EvherbA0zQSwdUc59VjpDH dQ=; b=BKRDBCH9cuiaE17CVqOAL38ft1swlQe4QY9jv53vAMVkoUa45sSH+MqEK uiKrRSiERU953KRTg8jBhoy7HG+sPcNBFcqfw7m5l8skgHa6HiB8OgzAx0P2s+dS 5HegPp8NhTEtnKOxYMznBgmrFEEohAiYU4wggvop78MHAm/Uzypq+qGPUysh70Wo GusZWFNErYyR6GS0ymsP0tzk0QUDDNhzqrXcNlt8tF8s/UX5cF3okDaC3FbCNS5X KnB6LG7ZBAP2gCXLTHG1mG6L0qarKID0V/UIql7qA8Q1RFbriwEZE6g/pWk1FEvN 4xWMA2a+bPc/u0aaSK7CUydS84ekw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefvddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtvdenucfhrhhomhepnfgrfihr vghntggvpgggvghljoiiqhhuvgiiuceovhhqsehlrghrrhihvhdrmhgvqeenucggtffrrg htthgvrhhnpeegteehjeeukeegffehhfejveejieehgedvueegkedtgeffjefhheegtefg jeelvdenucfkphepuddttddruddvrddukedtrdehfeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehvqheslhgrrhhrhihvrdhmvg X-ME-Proxy: In-Reply-To: X-Mailer: Apple Mail (2.3445.104.15) Received-SPF: pass client-ip=66.111.4.27; envelope-from=vq@larryv.me; helo=out3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/29 21:12:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:16861 > On Aug 29, 2020, at 8:41 PM, Bruce Lilly = wrote: >=20 >> On Sat, Aug 29, 2020 at 4:53 PM Koichi Murase = wrote: >>=20 >> Yes, I know that it is confusing to those who are familiar with = modern >> Perl-style regular expressions. But historically, POSIX regular >> expressions do not support the backslash escape sequences in bracket >> expressions `[...]'. The backslash escape sequences in bracket >> expressions were the extension historically. As far as I know, in >> POSIX, only awk supports backslash sequences in regular expressions. >=20 > Actually, it works (portably) with > separator2=3D$'\057' (a) $'...' is not POSIX. For instance, dash does not recognize it. % port installed dash The following ports are currently installed: dash @0.5.11.1_0 (active) % dash <<\EOF heredoc> printf '<%s>\n' $'\057' heredoc> EOF <$\057> (b) If you define separator2 in that way and then substitute it, the context into which it is substituted sees a slash character, not the backslash-escaped octal. $ echo "$BASH_VERSION" 5.0.17(1)-release $ printf '%s\n' $'\057' / vq=