Re: use of "build.sh -B BUILDID".... with patch and more questions

Jarle Greipsland <[email protected]>
Newsgroups gmane.os.netbsd.current,gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
Robert Elz <[email protected]> writes:
>     Date:        Thu, 04 Dec 2025 14:45:38 -0800
>     From:        "Greg A. Woods" <[email protected]>
>     Message-ID:  <[email protected]>
> 
> 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.
> 
> The second will set the variable to '' if the final character of its
> value is a blank, otherwise (somewhat slowly, but not really measurably)
> do nothing.  That couldn't actually change anything here, as all blanks
> would be removed by the first of the two commands.
> 
> There is no trivial way to achieve what you want, unless there are
> restrictions on what is in ${val} initially.
You might get away with:
  val=${val#"${val%%[![:blank:]]*}"}
  val=${val%"${val##*[![:blank:]]}"}

					-jarle
-- 
"Occasionally, I start to think maybe I'm a bit mad!  But then the voices
 re-assure me that I'm just as normal as everyone else!"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.