Re: ver_linux script

From: Alan Modra (alan@SPRI.Levels.UniSA.Edu.Au)
Date: Sun Mar 12 2000 - 23:18:55 EST


On Mon, 13 Mar 2000, Alan Cox wrote:

> > alias ls='ls -F'
> > . ver_linux
> >
>
> Perhaps we should use /bin/ls ?

Or fix it this way. This patch has two fixes from 2.3.51 (looks -> look,
stderr redirect for expr), the extra sed command to remove the ls -F
lossage, and another fix (awk libc regexp) I found necessary on my system
due to transition from libc5 to glibc2.

$ ldd /bin/sh
        libncurses.so.4 => /usr/i586-linuxlibc1/lib/libncurses.so.4 (0x4000b000)
        libc.so.5 => /usr/i586-linuxlibc1/lib/libc.so.5 (0x4004a000)

--- linux-2.2.14/scripts/ver_linux~ Mon Jan 10 23:29:03 2000
+++ linux-2.2.14/scripts/ver_linux Mon Mar 13 14:45:12 2000
@@ -1,23 +1,25 @@
 #!/bin/sh
 # Before running this script please ensure that your PATH is
-# typical as you use for compilation/istallation. I use
+# 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.
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-echo '-- Versions installed: (if some fields are empty or looks'
+echo '-- Versions installed: (if some fields are empty or look'
 echo '-- unusual then possibly you have very old versions)'
 uname -a
 insmod -V 2>&1 | awk 'NR==1 {print "Kernel modules ",$NF}'
 echo "Gnu C " `gcc --version`
 ld -v 2>&1 | awk -F\) '{print $1}' | awk \
       '/BFD/{print "Binutils ",$NF}'
-ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed -e 's/\.so$//' \
- | awk -F'[.-]' '{print "Linux C Library " $(NF-2)"."$(NF-1)"."$NF}'
+ls -l `ldd /bin/sh | awk '/(^|\/)libc/{print $3}'`
+ | sed -e 's,[\*/|]$,,' -e 's/\.so$//' \
+ | awk -F'[.-]' '{print "Linux C Library " $(NF-2)"."$(NF-1)"."$NF}'
 echo -n "Dynamic linker "
 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1
-ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \
- '{print "Linux C++ Library " $4"."$5"."$6}'
+ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null
+ | sed -e 's,[\*/|]$,,'
+ | awk -F. '{print "Linux C++ Library " $4"."$5"."$6}'
 ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}'
 mount --version | awk -F\- '{print "Mount ", $NF}'
 hostname -V 2>&1 | awk 'NR==1{print "Net-tools ", $NF}'
@@ -27,6 +29,6 @@
 # while console-tools needs 'loadkeys -V'.
 loadkeys -V 2>&1 | awk \
 '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}'
-expr --v | awk 'NR==1{print "Sh-utils ", $NF}'
+expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}'
 X=`cat /proc/modules | sed -e "s/ .*$//"`
 echo "Modules Loaded "$X

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:23 EST