Groups | Search | Server Info | Login | Register
Groups > muc.lists.netbsd.tech.toolchain > #3576
| Path | csiph.com!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail |
|---|---|
| From | "Greg A. Woods" <woods@planix.ca> |
| Newsgroups | muc.lists.netbsd.tech.toolchain |
| Subject | Re: use of "build.sh -B BUILDID".... with patch and more questions |
| Date | Thu, 04 Dec 2025 22:37:43 -0800 |
| Organization | Planix, Inc. |
| Sender | tech-toolchain-owner@NetBSD.org |
| Approved | news-admin@muc.de |
| Distribution | world |
| Message-ID | <m1vRPRn-00Mo5fC@more.local> (permalink) |
| References | <> <21226.1764899480@jacaranda.noi.kre.to> |
| Reply-To | NetBSD-current Users Discussion List <current-users@netbsd.org>, NetBSD Toolchain and Build Technical Discussion List <tech-toolchain@NetBSD.org> |
| MIME-Version | 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") |
| Content-Type | multipart/signed; boundary="pgp-sign-Multipart_Thu_Dec__4_22:30:58_2025-1"; micalg=pgp-sha1; protocol="application/pgp-signature" |
| Content-Transfer-Encoding | 7bit |
| Injection-Info | news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="60005"; mail-complaints-to="news-admin@muc.de" |
| User-Agent | Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-unknown-netbsd) MULE/6.0 (HANACHIRUSATO) |
| In-Reply-To | <21226.1764899480@jacaranda.noi.kre.to> |
| X-Face | ;j3Eth2XV8h1Yfu<eXd9JL+"t;iT8?{X]Fjm`Qb]>*uL{<:dQ$#E[DB0gemGZJ"J#4fH*][ lz;@-iwMv_u\6uIEKR0KY"=MzoQH#CrqBN`nG_5B@rrM8,f~Gr&h5a\=<t0loVf0$}bP=]i3OMh"n_ _@m4/,~2`V=(-9LyW.)'`@E_fE^<4y7)BIe`A''/j-Y#gDNZERh%CCij'q-NA4F<|yjznEhd7=l^xH 2.qD3o0IanGHERTW+z$G |
| Precedence | bulk |
| X-Newsgate-Id | f02c70b8849f+ |
| X-No-Archive | Yes |
| Xref | csiph.com muc.lists.netbsd.tech.toolchain:3576 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
At Fri, 05 Dec 2025 08:51:20 +0700, Robert Elz <kre@munnari.OZ.AU> wrote:
Subject: Re: use of "build.sh -B BUILDID".... with patch and more questions
>
> I haven't really been following this, I'd never heard of BUILDID
> before, but:
>
> | + # remove any leading (and trailing) whitespace
> | + val=${val##*[[:blank:]]}
> | + val=${val%%*[[:blank:]]}
>
> Those don't do what you want, the first would remove everything up
> to, and including, the rightmost blank in the variable's value.
Oops! Sigh, I had only tested those with ksh, but not even properly
there it seems.
I think though I've settled on just letting the shell do it while
parsing a command line, i.e.:
var=$(echo $var)
That gets rid of extraneous duplicate whitespace between words too.
In a function taking a varname argument:
trim ()
{
local _var _val
if [ $# -ne 1 -o -z "${1}" ] ; then
echo "Usage: trim varname" >&2
return 2
fi
_var="$1"
eval _val=\"\${${_var}}\"
eval ${_var}=\$\(echo \${_val}\)
unset _var _val
}
--
Greg A. Woods <gwoods@acm.org>
Kelowna, BC +1 250 762-7675 RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Avoncote Farms <woods@avoncote.ca>
Back to muc.lists.netbsd.tech.toolchain | Previous | Next — Previous in thread | Next in thread | Find similar
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-11-30 17:46 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-03 10:50 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-04 14:45 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions Robert Elz <kre@munnari.OZ.AU> - 2025-12-05 08:51 +0700
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-04 22:37 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-04 22:49 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions Jarle Greipsland <jarle.greipsland@norid.no> - 2025-12-05 09:33 +0100
Re: use of "build.sh -B BUILDID".... with patch and more questions RVP <rvp@SDF.ORG> - 2025-12-08 06:51 +0000
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-08 01:12 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions Jarle Greipsland <jarle.greipsland@norid.no> - 2025-12-08 11:59 +0100
Re: use of "build.sh -B BUILDID".... with patch and more questions "Greg A. Woods" <woods@planix.ca> - 2025-12-08 17:58 -0800
Re: use of "build.sh -B BUILDID".... with patch and more questions Jarle Greipsland <jarle.greipsland@norid.no> - 2025-12-09 11:14 +0100
csiph-web