From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932065AbcF1K0v (ORCPT ); Tue, 28 Jun 2016 06:26:51 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:32914 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbcF1KUW (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 30/32] ver_linux: build a list of kernel modules as a string and print it Date: Tue, 28 Jun 2016 13:19:04 +0300 Message-Id: <1467109146-20331-30-git-send-email-alexander.kapshuk@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1467109146-20331-1-git-send-email-alexander.kapshuk@gmail.com> References: <1467109146-20331-1-git-send-email-alexander.kapshuk@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reimplement the code that generates an alphabetically sorted list of kernel modules in awk and print the name of this entry and the list of modules via a function call. Signed-off-by: Alexander Kapshuk --- scripts/ver_linux | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/ver_linux b/scripts/ver_linux index 6bba20c..3bf72ad 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux @@ -61,16 +61,11 @@ BEGIN { printversion("Udev", version("udevadm --version 2>&1")) printversion("Wireless-tools", version("iwconfig --version 2>&1")) -test -e /proc/modules && -sort /proc/modules | -sed ' - s/ .*// - H -${ - g - s/^\n/Modules Loaded\t\t/ - y/\n/ / - q + if (system("test -r /proc/modules") == 0) { + while ("sort /proc/modules" | getline > 0) { + mods = mods sep $1 + sep = " " + } + printversion("Modules Loaded", mods) + } } - d -' -- 2.7.3