tech-toolchain archive

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

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



Robert Elz <kre%munnari.OZ.AU@localhost> writes:
>     Date:        Thu, 04 Dec 2025 14:45:38 -0800
>     From:        "Greg A. Woods" <woods%planix.ca@localhost>
>     Message-ID:  <m1vRI4w-00Mo5f0@more.local>
> 
> 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!"



Home | Main Index | Thread Index | Old Index