lkml.org 
[lkml]   [1999]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ver_linux script error?

Hello Tuan, Please try the one below ... Hth

On Thu, 21 Jan 1999, Tuan Hoang wrote:
> Hi,
> I just installed 2.2.0-pre9 and I have net-tools 1.49
> install but the ver_linux script uses the date
> from netstat rather than the version of net-tools.
> Thanks,
> Tuan
, JimL
+-----------------------------------------------------------------------+
| James W. Laferriere - Network Engineer - babydr@baby-dragons.com |
| System Techniques - 25416 - 22nd S. - Des-Moines, WA 98198 |
| Give me VMS -or- Give me Linux -but- only on AXP |
+-----------------------------------------------------------------------+
#!/bin/sh
# ver_linux (by Evgeny Rodichev <URL:mailto:er@sai.msu.su>
# 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.
# Modified: JimL babydr@nwrain.net 1998-Apr-25
# Modified: A.Reid linux@jonction.net 1998-04-26 (Added Debian check)
# Modified: JimL babydr@nwrain.net 1998-Jul-07
#
declare -i LIBVER TESTNET testslk
testslk=0
echo '-- Versions installed: (if some fields are empty or looks'
echo '-- unusual then possibly you have very old versions)'

#
# check for Debian
if [ -f /etc/debian_version ]; then
echo -n "Debian "; cat /etc/debian_version
fi

# check for Slackware
if [ -f /var/adm/packages/hdsetup ]; then
grep -i 'system v' /var/adm/packages/hdsetup | awk \
'{print $3,$7,$8}'
testslk=`grep -i 'system v' /var/adm/packages/hdsetup | awk '{print $8}' | \
awk -F. '{print $1$2$3}'`
fi

# check for redhat
if [ -f /etc/redhat-release ]; then
echo -n "Red Hat ";cat /etc/redhat-release
fi

#
uname -a

#
insmod -V 1>/tmp/ver_linux.tmp 2>>/tmp/ver_linux.tmp
awk 'NR==1{print "Kernel modules ",$NF}' /tmp/ver_linux.tmp
rm -f /tmp/ver_linux.tmp
#
echo "Gnu C " `gcc --version`
#
ld -v 2>&1 | awk -F\) '{print $1}' | awk \
'/BFD/{print "Binutils ",$NF}'

#
#echo "\$testslk="$testslk
if [ "$testslk" -ge 350 ]; then
SEED=`ldd /usr/bin/gcc | awk '/libc/{print $3}'`
else
SEED=`ldd /bin/sh | awk '/libc/{print $3}'`
fi
LIBVER=`ls -l $SEED | awk '{print $9}' | awk -F. '{print $3}'`
#echo $SEED" "$LIBVER
case $LIBVER in
4) echo -n "Linux C Library $LIBVER - "
ls -l $SEED | awk '{print $11}' | awk -F. '{print $1.$2.$3}' ;;
5) echo -n "Linux C Library $LIBVER - "
test=`ls -l $SEED | awk '{print $1}' | grep l`
if [ "$test" = "" ]; then
POS="9"
else
POS="11"
fi
# echo $POS","$test
ls -l $SEED | awk "{print $"$POS"}" | awk -F. '{print $3"."$4"."$5}'
;;
6) echo -n "Linux C Library $LIBVER - "
ls -l $SEED | awk '{print $11}' | awk -F. '{print $1"."$2"."$3}'
;;
esac
#ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | awk -F. \
# '{print "Linux C Library " $(NF-2)"."$(NF-1)"."$NF}'

#

TEST=`ldd -v 2> /dev/null`
if [ "$TEST" = "" ]; then
ldd --version | grep 'ldd' | awk '{print "Dynamic Linker (ld.so)", $4}'
else
ldd -v | grep 'ldd' | awk '{print "Dynamic Linker (ld.so)", $3}'
fi
#
ls -l /usr/lib/libg++.so | 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}'
#
TESTNET=`netstat --version | grep -c .`
if [ $TESTNET -gt 3 ]; then
netstat --version | awk \
'NR==1{if ($2 != "") { n=split($2,buf,"-"); ver=buf[n]; done=1 }}
NR==2{if (done != 1) ver=$3 }
END {print "Net-tools ",ver}'
else
netstat --version | grep tools | \
awk -F"-" '{print "Net-tools ",$3}'
fi
#
loadkeys -h 2>&1 | awk 'NR==1{print "Kbd ",$3}'
#
expr --v | awk '{print "Sh-utils ", $NF}'
#
flex --version | awk '{print "Flex ", $NF}'
#
e2fsck -V 2>&1 | awk -F"\, " '{print $1}' | \
awk '/version/{print "E2fsprogs ",$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/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:1.820 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site