Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

replacement for vmunix

Posted on 1998-04-28
7
Medium Priority
?
229 Views
Last Modified: 2010-04-21
I am porting an application from solaris1 to solaris2.  The application has the following command:

nm /vmunix | grep -w _msg | cut -c1-8

how do I obtain this address from solaris2?

Thanks in Advance
Eric
0
Comment
Question by:ethornsb
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:jos010697
ID: 2006496
Try /kernel/unix instead of /vmunix ...

kind regards,

Jos aka jos@and.nl
0
 

Author Comment

by:ethornsb
ID: 2006497
In my environment I have no /kernel/unix but instead genunix.  But it does not return the address as solaris1 does.  Here is what solaris1 does

nm /vmunix | grep -w _msg

returns

f01fa758 B _msg

solaris2 does this

nm genunix | grep -w msg

[2875]  |    4|    4|OBJT   |GLOB |0   |COMMON|msg

the address on solaris 1 is what I need?
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2006498
This shows that the output format of 'nm' differs on your Solaris2 box ...
first try to find the symbol using 'nm' and 'grep'; if found, pipe it
through 'cut' using the appropriate -c#-# flags ...

kind regards,

Jos aka jos@and.nl
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ethornsb
ID: 2006499
Yes, I understand that the output format differs.  That is why I have been unable to obtain the address.  My questions is how do I obtain the address from what the output shows on Solaris2 (in previous comment)?

my unix is not all that great - sorry if you've already said this but I need you to dumb it down a little

the points are yours with a grade A if you can provide anymore assistance.
0
 
LVL 2

Expert Comment

by:seedy
ID: 2006500
Use the '-P' option of nm.  This produces a portable output
format.
"nm -P genunix | grep -w msg" gives, in my machine,
     msg        D 00000004 00000004
The output is name, type, value(address) and the size.
So,
     nm -P genunix | grep -w msg | awk '{ print $3 }'
will get you the address of msg symbol.
PS:  Out of curiosity, why do you want to do this?
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 400 total points
ID: 2006501
or use 'sed' instead of 'cut'. Here's a way to do it:

   nm /vmunix | grep -w _msg | sed -f scriptfile

where 'scriptfile' contains the following little monster:

   s/\[\([0-9A-Za-z]*\)\].*/\1/

Basically, this reads: s/pattern/substitute/

where 'pattern' must match a left square bracket, a bunch of hexadecimal digits
and a right square bracket again. Everything between those square brackets
is pumped to standard output ...

instead of using the 'sed -f scriptfile' syntax, you could type in pass horrible
sed command to sed by putting it on the command line. The trouble is, that
your shell gobbles up all those nasty slashes, brackets etc. ...

kind regards,

Jos aka jos@and.nl

0
 

Author Comment

by:ethornsb
ID: 2006502
Thanks for all the help.  The reason I wanted to do this was because I am trying to port a network communication services pacakge from sol1 and sol2.  When starting the program 2 of the parameters required are the addresses of these two elements.

Thanks Again
Eric
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question