diff options
author | des <des@FreeBSD.org> | 2016-12-10 20:24:22 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2016-12-10 20:24:22 +0000 |
commit | 6abd291eeca18f7b912dca6abbc3538b5beb1ea9 (patch) | |
tree | 01ca6142ca77f05be9749e9b39e703fe6cfed4bf | |
parent | f2aa8e8a3677294ed9c7b702801bf62305c68ed1 (diff) | |
download | FreeBSD-src-6abd291eeca18f7b912dca6abbc3538b5beb1ea9.zip FreeBSD-src-6abd291eeca18f7b912dca6abbc3538b5beb1ea9.tar.gz |
MFH (r308297): use what(1) instead of strings(1).
PR: 213665
Submitted by: Pawel Worach <pawel.worach@gmail.com>
-rw-r--r-- | bin/freebsd-version/freebsd-version.sh.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/freebsd-version/freebsd-version.sh.in b/bin/freebsd-version/freebsd-version.sh.in index a830d26..1603410 100644 --- a/bin/freebsd-version/freebsd-version.sh.in +++ b/bin/freebsd-version/freebsd-version.sh.in @@ -36,7 +36,7 @@ USERLAND_VERSION="@@REVISION@@-@@BRANCH@@" : ${LOADER_CONF_FILES:=$LOADER_DIR/defaults/loader.conf $LOADER_DIR/loader.conf $LOADER_DIR/loader.conf.local} LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\{1,\}\).*$' LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$' -KERNEL_RE='^@(#)@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' +KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' progname=$(basename $0) @@ -67,7 +67,7 @@ kernel_version() { if [ ! -f "$kernfile" -o ! -r "$kernfile" ] ; then error "unable to locate kernel" fi - strings "$kernfile" | sed -n "s/$KERNEL_RE/\\1/p" + what -qs "$kernfile" | sed -n "s/$KERNEL_RE/\\1/p" } # |