"Fossies" - the Fresh Open Source Software Archive 
Member "mpr-2.8/config/mprnm.sunos" (27 Oct 2001, 736 Bytes) of package /linux/misc/old/mpr-2.8.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 #!/bin/sh
2
3 MPRAWK=${MPRAWK-awk}
4 popt=
5 Dopt=
6
7 for arg in "$@"; do
8 case "$1" in
9 -D) Dopt=-D;;
10 -p) popt=-p;;
11 --) shift; break;;
12 *) break;;
13 esac
14 shift
15 done
16
17 case "$#" in
18 1) aout=`mprwhich -s "$1"` || exit 1;;
19 *) echo "usage: mprnm [-D] [-p] a.out" >&2
20 exit 1;;
21 esac
22
23 case `file "$aout"` in
24 *ELF*) offset=1;;
25 *) offset=2;;
26 esac
27
28 nm $Dopt -v -p "$aout" 2>/dev/null |
29
30 $MPRAWK '
31 NF==3 && ($2 ~ /T|t|W|w/ || $3 ~ /^_init$/) && $3 !~ /(\.o$)|(g(nu|cc).*compiled)|(^\.L)/ {
32 if ($3 !~ /^_/)
33 printf "%s\t%s\n", $1, $3
34 else
35 printf "%s\t%s\n", $1, substr($3, '$offset')
36 }' |
37
38 mprdem $popt |
39
40 sed -e 's/global destructors keyed to /_GLOBAL_$D$/' \
41 -e 's/global constructors keyed to /_GLOBAL_$C$/' \
42 -e 's/::/<>/g'
43
44 exit 0