Chapter 1:

for b in /bin/* /usr/bin/*; do $b --version; done

I never did that but on a GNU system probably 90% of the programs
would support that option.
Good thing... looks like a standard, standards are good, aren't they?

me: well, is there a standard for the version string?
GNU: of course not!  why should there?
me: to make parsing the output easier for scripts?
GNU: hm never thought of that...
me: I see
GNU: but look, we can come up with real good regular expressions like this:

ldver=`$LD --version 2>/dev/null | head -1 | \
        sed -e 's/GNU \(go\)\{0,1\}ld \(version \)\{0,1\}\(([^)]*)
\)\{0,1\}\([0-9.][0-9.]*\).*/\4/'

     and then we do some calculation:

glibcxx_gnu_ld_version=`echo $ldver | \
        $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`

me: oh yes that's very impressive.
(me goes back to work, and compiles the latest GCC under Solaris,
which takes a few
hours and a zillion lines of output never noticing the big fat warning
that LD is too old and therefore symbol versioning will be disabled...)

[a few months later]

GNU: oh sorry Sun's (or should I say Oracle's) sed does not support
the \(..\)\{..\}
    construct we never noticed because WE ARE GNU. RESISTANCE IS FUTILE.

Chapter 2:

/lib/libc.so.6 | grep version

[to be continued]

Reply via email to