You wrote:
> 
>     Date:        Mon, 28 Jun 2021 12:18:50 +0000 (UTC)
>     From:        RVP <[email protected]>
>     Message-ID:  <[email protected]>
> 
>   | echo $(sysctl -n machdep.dmi.system-vendor)
> 
> That's a convoluted way of writing
>       sysctl -n machdep.dmi.system-vendor
> and one which could fail if the string just happened to contain
> the "wrong" characters (depending upon which version of echo is
> being used for which are "wrong" for this purpose).
> 
> kre
> 

FWIW this is what I put in my (Tcl) script:

set vendorprod [split [exec  /sbin/sysctl -n machdep.dmi.system-vendor \
machdep.dmi.system-product machdep.dmi.system-version] "\n"]

It turns out that different machines may have either of the last two
blank but not empty, with the product's name arbitrarily in one position or
the other.

--
Steve Blinkhorn <[email protected]>

Reply via email to