newvers: Use correct regexp

There's no need to quote the # here. Inside of regexp, it's not treated
like a comment from an awk perspective. And inside if '' it's not
treated as special by the shell. gawk also warns.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2023-04-21 10:14:41 -06:00
parent 92fa22c6a5
commit 2c19beeed2

View File

@ -65,7 +65,7 @@ if [ -z "${SYSDIR}" ]; then
SYSDIR=$(dirname $0)/..
fi
RELDATE=$(awk '/^\#define[[:space:]]*__FreeBSD_version/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h})
RELDATE=$(awk '/^#define[[:space:]]*__FreeBSD_version/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h})
if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)