Solved

replacement for vmunix

Posted on 1998-04-28
7
222 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
Independent Software Vendors: 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 100 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cron job says it ran, no results 25 136
Linux: disable vim auto-comment 7 172
Shell Script on AIX 7 177
How to make a Bash alias that takes parameters 5 93
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
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.:

739 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