I am trying to port a python script to an old Solaris 10 machine. I downloaded and installed all the required packages from sunfreeware. It crashed in the import line (import CGIHTTPServer) with this error message:


  ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python2.6/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found


I tried to recompile with libresolve, but I didn't want to do that, so I copied the file _socket.so to my linux machine and edited with ghex2. I replaced the inet_aton with inet_pton because i read that solaris uses inet_pton instead. I've also read in python documentation that both system calls are similar.

I copied back the file _socket.so to the original dir, backed up the old one and replaced with the patched one. It's running and looks OK so far.

Do you think the python socket module will break in the future? 

Do inet_aton and inet_pton return structs compatible? 


Question: ignore lines grep
Answer: Sorry can't resist:

myproc | perl -ne "/requests/ or print"


that's a perl one liner that uses -e to execute code on the command line, and -n to wrap it in a while loop reading one line at a time.  The /requests/ part is a match against any line that contains the word 'requests`.  Putting it all together says, "if the line doesn't contain the word 'requests', print it out."

This is a  contrived example since Robin Green points out that grep -v works just fine in your case.  However you can extend this perl one liner to make an arbitrarily complex filter.