public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: All <cygwin@cygwin.com>
Subject: Parameter expansion stopped working in recent ash/dash
Date: Tue, 7 Feb 2023 15:07:59 +0300	[thread overview]
Message-ID: <1552195602.20230207150759@yandex.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

Greetings, All!

In the attached script, that I always run using dash, the expansion is
supposed to strip leading/trailing spaces from provided parameter.

The upgrade that took place after which the expansion stopped working is

libsolv:   - dash-0.5.11.5-1.any -> dash-0.5.12-1.any

Downgrading to 0.5.11.5 restored the expected behavior.
I failed to find anything relevant in the dash 0.5.12 patch notes, but perhaps
community could help?


-- 
With best regards,
Andrey Repin
Tuesday, February 7, 2023 14:49:46

Sorry for my terrible english...

[-- Attachment #2: par-ext.sh --]
[-- Type: application/octet-stream, Size: 276 bytes --]

#!/bin/dash -x

trim() {
  # remove leading whitespace characters
  __trim="${*#${*%%[![:space:]]*}}"
  # remove trailing whitespace characters
  printf "%s" "${__trim%${__trim##*[![:space:]]}}"
}

trim " alpha" | od -t x1a
trim "beta " | od -t x1a
trim "\rgamma	" | od -t x1a

             reply	other threads:[~2023-02-07 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 12:07 Andrey Repin [this message]
2023-02-07 17:19 ` Brian Inglis
2023-02-07 19:01   ` Brian Inglis
2023-02-08 14:20     ` Brian Inglis
2023-02-09 12:08       ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1552195602.20230207150759@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).