Re: ver_linux script

From: Barry K. Nathan (barryn@pobox.com)
Date: Mon Mar 13 2000 - 18:04:17 EST


FWIW, Riley's second patch made no difference for me either. (Bash 1.14.7(1),
in case that matters.) Strangely enough, the unalias -a seems to have no
effect in the subshell! :|

Here's an alternate patch. This one puts a backslash before the ls statements,
so that the alias is bypassed. It's not as conceptually clean as Riley's
approach, but it works (for me, at least).

Also, invoking the ver_linux script as "./ver_linux" (assuming correct
permissions) or "sh ver_linux", instead of ". ver_linux" seems to fix the
problem for me, regardless of whether any patch has been applied. Perhaps,
if there are no disadvantages to this approach (I don't have time to give it
serious thought right now), it would be better to make a patch that refuses
to run and gives an appropriate error message in the presence of aliases, or
that runs itself again using an explicit "sh" command in the presence of
aliases. I probably won't have time to implement either of the above for two
weeks or so, however...

-Barry K. Nathan <barryn@pobox.com>

--- linux-2.3.52-pre2-original/scripts/ver_linux Tue Dec 14 23:05:03 1999
+++ linux-2.3.52-pre2/scripts/ver_linux Mon Mar 13 14:41:25 2000
@@ -1,10 +1,9 @@
 #!/bin/sh
-# Before running this script please ensure that your PATH is
-# typical as you use for compilation/istallation. 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 'NOTE: This script assumes that you use the same PATH when compiling'
+echo ' the kernel as is currently set in your environment. If such is'
+echo ' NOT the case, please set the relevant path, then rerun this'
+echo ' ver_linux script and report the resulting values instead.'
+echo
 echo '-- Versions installed: (if some fields are empty or look'
 echo '-- unusual then possibly you have very old versions)'
 uname -a
@@ -12,11 +11,11 @@
 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$//' \
+\ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed -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. \
+\ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | 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}'

-
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:26 EST