Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

replacement for vmunix

Posted on 1998-04-28
7
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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

721 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