[PATCH 01/32] ver_linux: complete awk implementation

From: Alexander Kapshuk
Date: Tue Jun 28 2016 - 06:20:43 EST


The algorithm that extracts the version number of the utility being
queried, and prints the name of the utility and its version number is
currently implemented in awk. The code is used throughout the script,
making its use repetative. The proposed implementation confines the
algorithm in question to a function, which makes the script easier to
read overall, as well as considerably reduces the number of lines of
code. Every attempt has been made to retain the look and the format
generated by the current implementation.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@xxxxxxxxx>
---
scripts/ver_linux | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 0d8bd29..30ecc6c 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/awk -f
# Before running this script please ensure that your PATH is
# typical as you use for compilation/installation. I use
# /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
# differ on your system.
-#
+
echo 'If some fields are empty or look unusual you may have an old version.'
echo 'Compare to the current minimal requirements in Documentation/Changes.'
echo ' '
--
2.7.3