简体   繁体   中英

Script cannot find existing file

I am trying to run a script named sassetup in folder /usr/local/SASHome/SASFoundation/9.4 on a linux machine. The first two lines of the script are as follows.

eval 'exec `dirname $0`/perl/bin/perl5 -U $0 ${1+"$@"}'
    if $running_under_some_shell;

I get an error message saying

./sassetup: line 1: /usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5: No such file or directory

The file in the error message actually exists because the command below

ls -lt /usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5

outputs

-rwxr-xr-x 3 5402 users 790559 Jan 24  2002 /usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5

The output of

uname -a

is

Linux 4.15.0-112-generic 16.04.1-Ubuntu SMP x86_64 GNU/Linux

The output of

file /usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5

is

/usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped

The file /lib/ld-linux.so.2 does not exist. Two similar files, /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 and /lib64/ld-linux-x86-64.so.2, exist.

The output of adding LD_DEBUG=all before the command when running is as follows.

     14403: 
 14403: file=/lib/$LIB/liblsp.so [0];  needed by sh [0]
 14403: file=/lib/$LIB/liblsp.so [0];  generating link map
 14403:   dynamic: 0x00007fc46f12fdf0  base: 0x00007fc46ef2c000   size: 0x0000000000204348
 14403:     entry: 0x00007fc46ef2d450  phdr: 0x00007fc46ef2c040  phnum:                  7
 14403: 
 14403: 
 14403: file=libtinfo.so.5 [0];  needed by sh [0]
 14403: find library=libtinfo.so.5 [0]; searching
 14403:  search cache=/etc/ld.so.cache
 14403:   trying file=/lib/x86_64-linux-gnu/libtinfo.so.5
 14403: 
 14403: file=libtinfo.so.5 [0];  generating link map
 14403:   dynamic: 0x00007fc46ef2ad08  base: 0x00007fc46ed03000   size: 0x0000000000228cc0
 14403:     entry: 0x00007fc46ed0f870  phdr: 0x00007fc46ed03040  phnum:                  7
 14403: 
 14403: 
 14403: file=libdl.so.2 [0];  needed by sh [0]
 14403: find library=libdl.so.2 [0]; searching
 14403:  search cache=/etc/ld.so.cache
 14403:   trying file=/lib/x86_64-linux-gnu/libdl.so.2
 14403: 
 14403: file=libdl.so.2 [0];  generating link map
 14403:   dynamic: 0x00007fc46ed01d88  base: 0x00007fc46eaff000   size: 0x00000000002030f0
 14403:     entry: 0x00007fc46eaffda0  phdr: 0x00007fc46eaff040  phnum:                  7
 14403: 
 14403: 
 14403: file=libc.so.6 [0];  needed by sh [0]
 14403: find library=libc.so.6 [0]; searching
 14403:  search cache=/etc/ld.so.cache
 14403:   trying file=/lib/x86_64-linux-gnu/libc.so.6
 14403: 
 14403: file=libc.so.6 [0];  generating link map
 14403:   dynamic: 0x00007fc46eaf8ba0  base: 0x00007fc46e735000   size: 0x00000000003c99a0
 14403:     entry: 0x00007fc46e755960  phdr: 0x00007fc46e735040  phnum:                 10
 14403: 
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libdl.so.2 [0] required by file sh [0]
 14403: checking for version `NCURSES_TINFO_5.0.19991023' in file /lib/x86_64-linux-gnu/libtinfo.so.5 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.11' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.14' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.8' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.15' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.4' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.3.4' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.3' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file sh [0]
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libdl.so.2 [0] required by file /lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: checking for version `GLIBC_2.4' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: checking for version `GLIBC_2.3' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_2.14' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_2.16' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_2.4' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_2.3.4' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: checking for version `GLIBC_PRIVATE' in file /lib64/ld-linux-x86-64.so.2 [0] required by file /lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: checking for version `GLIBC_PRIVATE' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: checking for version `GLIBC_2.2.5' in file /lib/x86_64-linux-gnu/libc.so.6 [0] required by file /lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: checking for version `GLIBC_2.3' in file /lib64/ld-linux-x86-64.so.2 [0] required by file /lib/x86_64-linux-gnu/libc.so.6 [0]
 14403: checking for version `GLIBC_PRIVATE' in file /lib64/ld-linux-x86-64.so.2 [0] required by file /lib/x86_64-linux-gnu/libc.so.6 [0]
 14403: 
 14403: Initial object scopes
 14403: object=sh [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403: 
 14403: object=linux-vdso.so.1 [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403:  scope 1: linux-vdso.so.1
 14403: 
 14403: object=/lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403: 
 14403: object=/lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403: 
 14403: object=/lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403: 
 14403: object=/lib/x86_64-linux-gnu/libc.so.6 [0]
 14403:  scope 0: sh /lib/lib/x86_64-linux-gnu/liblsp.so /lib/x86_64-linux-gnu/libtinfo.so.5 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
 14403: 
 14403: object=/lib64/ld-linux-x86-64.so.2 [0]
 14403:  no scope
 14403: 
 14403: 
 14403: relocation processing: /lib/x86_64-linux-gnu/libc.so.6 (lazy)
 14403: symbol=_res;  lookup in file=sh [0]
 14403: symbol=_res;  lookup in file=/lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: symbol=_res;  lookup in file=/lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: symbol=_res;  lookup in file=/lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: symbol=_res;  lookup in file=/lib/x86_64-linux-gnu/libc.so.6 [0]
 14403: binding file /lib/x86_64-linux-gnu/libc.so.6 [0] to /lib/x86_64-linux-gnu/libc.so.6 [0]: normal symbol `_res' [GLIBC_2.2.5]
 14403: symbol=stderr;  lookup in file=sh [0]
 14403: binding file /lib/x86_64-linux-gnu/libc.so.6 [0] to sh [0]: normal symbol `stderr' [GLIBC_2.2.5]
 14403: symbol=error_one_per_line;  lookup in file=sh [0]
 14403: symbol=error_one_per_line;  lookup in file=/lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: symbol=error_one_per_line;  lookup in file=/lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: symbol=error_one_per_line;  lookup in file=/lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: symbol=error_one_per_line;  lookup in file=/lib/x86_64-linux-gnu/libc.so.6 [0]
 14403: binding file /lib/x86_64-linux-gnu/libc.so.6 [0] to /lib/x86_64-linux-gnu/libc.so.6 [0]: normal symbol `error_one_per_line' [GLIBC_2.2.5]
 14403: symbol=__malloc_initialize_hook;  lookup in file=sh [0]
 14403: symbol=__malloc_initialize_hook;  lookup in file=/lib/lib/x86_64-linux-gnu/liblsp.so [0]
 14403: symbol=__malloc_initialize_hook;  lookup in file=/lib/x86_64-linux-gnu/libtinfo.so.5 [0]
 14403: symbol=__malloc_initialize_hook;  lookup in file=/lib/x86_64-linux-gnu/libdl.so.2 [0]
 14403: symbol=__malloc_initialize_hook;  lookup in file=/lib/x86_64-linux-gnu/libc.so.6 [0]
 14403: binding file /lib/x86_64-linux-gnu/libc.so.6 [0] to /lib/x86_64-linux-gnu/libc.so.6 [0]: normal symbol `__malloc_initialize_hook' [GLIBC_2.2.5]

How do I make sure that the script finds this file?

Linux 4.15.0-112-generic 16.04.1-Ubuntu SMP x86_64 GNU/Linux

Your system is 64-bit.

/usr/local/SASHome/SASFoundation/9.4/perl/bin/perl5: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped

The application is 32-bit.

The file /lib/ld-linux.so.2 does not exist

You have to install the 32-bit versions of libraries to run 32-bit applications under 64-bit. Install glibc compiled for 32-bit. On my archlinux the package is called lib32-glibc .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM