Operating System - HP-UX
1833801 Members
2546 Online
110063 Solutions
New Discussion

How "what" recognises version of Binary or Shared Library?

 
vasundhara
Frequent Advisor

How "what" recognises version of Binary or Shared Library?

Hi,

Can anyone help me how the version of binaries/ shared libraries is updated in HP- Unix? If we give what command on any binary, how the version will be displayed? If we give "what ", from where "what" takes version of ?

Thanks in advance.
VJ
10 REPLIES 10
malay boy
Trusted Contributor

Re: How "what" recognises version of Binary or Shared Library?

# what more
more:
$Revision: 82.3 $

Above is what command for more binary in my machine.

I guest the version of binaris are updated with applying the patch.

regards
mB
There are three person in my team-Me ,myself and I.
T G Manikandan
Honored Contributor

Re: How "what" recognises version of Binary or Shared Library?

Each binary has some information in it which starts like
@(#)

what searches this pattern and gets the information regarding the version from here.

you can do a

#what /usr/bin/ls

to get the revision info

Do a
#strings /usr/bin/ls|more

check for the pattern @(#) there.
Michael Tully
Honored Contributor

Re: How "what" recognises version of Binary or Shared Library?

It takes it from the fileset that has been loaded.
For example, if a binary has been patched, a patch number may be included or the problem number that is generated from the HP lab.

e.g

# what /usr/bin/ftp
root@beaver:/root 158 # what /usr/bin/ftp
/usr/bin/ftp:
$Revision: vw: cheriv_JAGad35417 selectors: CUPI80_BL2000_1025 'cup_cheriv_jagad35417'
Thu Oct 26 23:12:20 PDT 2000 $
Copyright (c) 1985, 1989 Regents of the University of California.

The "JAGad35417" is the number that is associated with the patch that was loaded.
Unfortunately some patch numbers do not appear in the binary, but the HP problem report/Lab reference does. In the above case, it is 'jagad35417'
If you have a look at a patch on HP's web site you will see exactly what I'm talking about.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"

Anyone for a Mutiny ?
ranganath ramachandra
Esteemed Contributor

Re: How "what" recognises version of Binary or Shared Library?

from 'man what'
--
The what command searches the given files for all occurrences of the
pattern that get(1) substitutes for %Z% (currently @(#) at this
printing) and prints out what follows until the first ", >, new-line,
\, or null character. For example, if the C program in file f.c
contains

char ident[] = "@(#)identification information";

and f.c is compiled to yield f.o and a.out, the command

what f.c f.o a.out

prints

f.c: identification information

f.o: identification information

a.out: identification information
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

doug hosking
Esteemed Contributor

Re: How "what" recognises version of Binary or Shared Library?

'what' doesn't have any concept of filesets.
(It can work on any binary, not just those that have been formally packaged into depots.)
It simply looks for the '@(#)' string described in the man page for what(1).

$ what /usr/bin/ls
/usr/bin/ls:
$Revision: B.11.11_LR
Wed Nov 8 19:15:12 PST 2000 $

$ strings -a /usr/bin/ls | grep 2000
@@(#) $Revision: B.11.11_LR\n @(#) Wed Nov 8 19:15:12 PST 2000 $

The build process for a given binary may
add a specific what string, as described in the
DESCRIPTION section of the what(1) man page.

The 'JAGad12345' style numbers refer to HP's internal defect tracking system entries and sometimes appear in what strings, especially in patched binaries. These may have meaning to a human reading the output from what(1) but have no special meaning to what itself.


John Bolene
Honored Contributor

Re: How "what" recognises version of Binary or Shared Library?

these are called what strings
good programmers add them

you can also look at them using
strings whatever-binary-you-want-here
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
John Bolene
Honored Contributor

Re: How "what" recognises version of Binary or Shared Library?

these are called what strings
good programmers add them

you can also look at them using
strings whatever-binary-you-want-here
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
vasundhara
Frequent Advisor

Re: How "what" recognises version of Binary or Shared Library?

Hi,

Thank you all for replying. But, I think I have to give my problem in more detail.

If a binary X is coming from more than one file, a.c, b.c c.c, a.h, b.h etc..., Each of these files will have their own versions. How the version of X will be updated??? If the binary is coming from only one file, what ever version we specify in that single file will become the version of the binary also. But, if it is coming from so many files, how the version of the binary is updated???

Thanks and Regards
VJ
twang
Honored Contributor

Re: How "what" recognises version of Binary or Shared Library?

i usually use what to find out what version of an executable file:
wmo_oas# which what
/usr/bin/what
wmo_oas# what /usr/bin/what
/usr/bin/what:
$Revision: 76.2 $

For utility which consist of more than one file, i will use swlist to search its fileset/product/bundle:
wmo_oas# swlist -l fileset |grep -i ignite
# Ignite-UX B.3.3.116 HP-UX System Installation Services
Ignite-UX.BOOT-KERNEL B.3.3.116 Installation Boot Kernel for S700/S800 clients
Ignite-UX.BOOT-SERVICES B.3.3.116 Network Boot Services for System Installations
Ignite-UX.FILE-SRV-11-00 B.3.3.116 File Archives Used By Clients During HP-UX Install
Ignite-UX.IGNITE B.3.3.116 Graphical Ignite User Interface for Installations
Ignite-UX.IGNT-ENG-A-MAN B.3.3.116 Ignite-UX Manual Pages
Ignite-UX.MGMT-TOOLS B.3.3.116 Tools for Managing Data Files on an Ignition Server
Ignite-UX.OBAM-RUN B.3.3.116 User Interface Libraries Needed for Older Systems
Ignite-UX.RECOVERY B.3.3.116 System disaster recovery tools

hope this helpful.
tommy
ranganath ramachandra
Esteemed Contributor

Re: How "what" recognises version of Binary or Shared Library?

i dont know if you got the answer yet -
what i found on hpux is that if any/many of the source files contain strings starting with "@(#)" then the what string of the binary built will contain all these strings.

multiple such strings may be within the same source file and still will be shown in the output of 'what'.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo