bad magic number

Hi,

when installing a piece of third part software I get the error "Bad magic number" at one point when it tries to use libraries from the bea tuxedo server. Am I correct that this means that the software is expecting 32bit while I'm on 64bit? Is there a way around it or can it only be solved during compilation time?

Thanks.

Which OS and shell are you using? Also, in the install script that throws the error, what is the path of the very first line in the script. It should be something like #!/bin/ksh (if its a korn shell script). Compare this setting with the output of which ksh. They should match (substitute ksh for whichever shell you are using). See this FAQ for information regarding the "Magic Number"

I'm using HP-UX 11vi with KSH

the script is written in perl but at least I know now where to look. I read somewhere that this error was common when upgrading from Oracle 8 32bit to Oracle 9i 64bit so I thought it might be a similiar problem.

You will get a bad magic number error when attempting to execute any interpreted script (be it perl or shell) when the sha-bang line (thats the magic number) does not correctly point to the path of the interpreter. Fix that and you should be good as gold. In your case, check the output of the command which perl and compare that to the first line of your perl script.

Remember that magic numbers are not just for shell scripts. Executables also have magic numbers. In fact, almost everything that is not a text file has a magic number. See
magic(4). And the file command uses a file called /etc/magic that lists them.

So this very well could be a 64 bit vs 32 bit problem. See our new faq "32 or 64 bit filesystems/files/OS's/CPU's" which has links to some info on the HP web site.

I'm definitely using a 64bit system. I suspect the software I'm trying to install is supposing it is on a 32bit system and throws an error when it tries to access a 64bit library. Is there a way of figuring that out?