Pete's Linux Advent Calendar 2008
The 1st day
Error messages and their not so obvious meaning
Under tcsh you sometimes get misleading errors. Have a look:
> ls -l myscript
-rwxr-xr-x 1 pete users 35 Nov 23 10:22 myscript
> ./myscript
./myscript: Command not found.
The error message indicates that the file does not exist, although
ls shows it is there.
The explanation lies in the interpreter line of myscript:
> head -n 1 myscript
#!/usr/bin/doesnotexist
But also under bash you can get such a message:
$ file hello
hello: ELF 32-bit LSB executable, ...
$ ./hello
bash: ./hello: No such file or directory
This has the same reason but here the loader which is compiled into
the program is missing.
$ strings - hello|grep linux
/lic/ld-linux.so.2
The directory /lic indeed does not exist. To still
execute the program, call the loader:
$ /lib/ld-linux.so.2 ./hello
hello