ver_linux: libc, input redirection to sed fails in some distros
[deliverable/linux.git] / scripts / ver_linux
1 #!/bin/sh
2 # Before running this script please ensure that your PATH is
3 # typical as you use for compilation/istallation. I use
4 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
5 # differ on your system.
6 #
7 echo 'If some fields are empty or look unusual you may have an old version.'
8 echo 'Compare to the current minimal requirements in Documentation/Changes.'
9 echo ' '
10
11 uname -a
12 echo ' '
13
14 gcc -dumpversion 2>&1 |
15 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
16 match($0, /[0-9]+([.]?[0-9]+)+/)
17 printf("GNU C\t\t\t%s\n",
18 substr($0,RSTART,RLENGTH))
19 }'
20
21 make --version 2>&1 |
22 awk '/GNU Make/{
23 match($0, /[0-9]+([.]?[0-9]+)+/)
24 printf("GNU Make\t\t%s\n",
25 substr($0,RSTART,RLENGTH))
26 }'
27
28 ld -v 2>&1 |
29 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
30 match($0, /[0-9]+([.]?[0-9]+)+/)
31 printf("Binutils\t\t%s\n",
32 substr($0,RSTART,RLENGTH))
33 }'
34
35 mount --version 2>&1 |
36 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
37 match($0, /[0-9]+([.]?[0-9]+)+/)
38 $0 = substr($0,RSTART,RLENGTH)
39 printf("Util-linux\t\t%s\nMount\t\t\t%s\n",$0,$0)
40 }'
41
42 depmod -V 2>&1 |
43 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
44 match($0, /[0-9]+([.]?[0-9]+)+/)
45 printf("Module-init-tools\t%s\n",
46 substr($0,RSTART,RLENGTH))
47 }'
48
49 tune2fs 2>&1 |
50 awk '/^tune2fs/{
51 match($0, /[0-9]+([.]?[0-9]+)+/)
52 printf("E2fsprogs\t\t%s\n",
53 substr($0,RSTART,RLENGTH))
54 }'
55
56 fsck.jfs -V 2>&1 |
57 awk '/version/{
58 match($0, /[0-9]+([.]?[0-9]+)+/)
59 printf("Jfsutils\t\t%s\n",
60 substr($0,RSTART,RLENGTH))
61 }'
62
63 reiserfsck -V 2>&1 |
64 awk '/^reiserfsck/{
65 match($0, /[0-9]+([.]?[0-9]+)+/)
66 printf("Reiserfsprogs\t\t%s\n",
67 substr($0,RSTART,RLENGTH))
68 }'
69
70 fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
71 'NR==1{print "reiser4progs ", $2}'
72
73 xfs_db -V 2>&1 |
74 awk '/version/{
75 match($0, /[0-9]+([.]?[0-9]+)+/)
76 printf("Xfsprogs\t\t%s\n",
77 substr($0,RSTART,RLENGTH))
78 }'
79
80 pccardctl -V 2>&1 |
81 awk '/pcmciautils/{
82 match($0, /[0-9]+([.]?[0-9]+)+/)
83 printf("Pcmciautils\t\t%s\n",
84 substr($0,RSTART,RLENGTH))
85 }'
86
87 cardmgr -V 2>&1| grep version | awk \
88 'NR==1{print "pcmcia-cs ", $3}'
89
90 quota -V 2>&1 |
91 awk '/version/{
92 match($0, /[0-9]+([.]?[0-9]+)+/)
93 printf("Quota-tools\t\t%s\n",
94 substr($0,RSTART,RLENGTH))
95 }'
96
97 pppd --version 2>&1 |
98 awk '/version/{
99 match($0, /[0-9]+([.]?[0-9]+)+/)
100 printf("PPP\t\t\t%s\n",
101 substr($0,RSTART,RLENGTH))
102 }'
103
104 isdnctrl 2>&1 | grep version | awk \
105 'NR==1{print "isdn4k-utils ", $NF}'
106
107 showmount --version 2>&1 | grep nfs-utils | awk \
108 'NR==1{print "nfs-utils ", $NF}'
109
110 test -r /proc/self/maps &&
111 sed '
112 /.*libc-\(.*\)\.so$/!d
113 s//Linux C Library\t\t\1/
114 q
115 ' /proc/self/maps
116
117 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
118 'NR==1{print "Dynamic linker (ldd) ", $NF}'
119
120 ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \
121 '{print "Linux C++ Library " $4"."$5"."$6}'
122
123 ps --version 2>&1 | grep version | awk \
124 'NR==1{print "Procps ", $NF}'
125
126 ifconfig --version 2>&1 | grep tools | awk \
127 'NR==1{print "Net-tools ", $NF}'
128
129 # Kbd needs 'loadkeys -h',
130 loadkeys -h 2>&1 | awk \
131 '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}'
132
133 # while console-tools needs 'loadkeys -V'.
134 loadkeys -V 2>&1 | awk \
135 '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}'
136
137 oprofiled --version 2>&1 | awk \
138 '(NR==1 && ($2 == "oprofile")) {print "oprofile ", $3}'
139
140 expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}'
141
142 udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}'
143
144 iwconfig --version 2>&1 | awk \
145 '(NR==1 && ($3 == "version")) {print "wireless-tools ",$4}'
146
147 if [ -e /proc/modules ]; then
148 X=`cat /proc/modules | sed -e "s/ .*$//"`
149 echo "Modules Loaded "$X
150 fi
This page took 0.037174 seconds and 6 git commands to generate.