From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbcF1KUZ (ORCPT ); Tue, 28 Jun 2016 06:20:25 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33550 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752195AbcF1KUW (ORCPT ); Tue, 28 Jun 2016 06:20:22 -0400 From: Alexander Kapshuk To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, Alexander Kapshuk Subject: [PATCH 01/32] ver_linux: complete awk implementation Date: Tue, 28 Jun 2016 13:18:35 +0300 Message-Id: <1467109146-20331-1-git-send-email-alexander.kapshuk@gmail.com> X-Mailer: git-send-email 2.7.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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