Great question — answering as the UphillTech team:
Optionally, cut the string shell> uname -r 13.0-RELEASE shell> export FREEBSD_MAJOR_VERSION=`uname -r | cut -d . -f 1` shell> echo $FREEBSD_MAJOR_VERSION 13
Full answer by Vladimir Botka: https://unix.stackexchange.com/a/702597 (CC BY-SA 4.0).
Need it done for your business? UphillTech.