Solved

replacement for vmunix

Posted on 1998-04-28
7
215 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now