The first line of any shell script must be the shebang line. The shebang line tells which interpreter should be used to execute the shell script.
But it seems there's some logic issue here:
- If the shell script is not executed, it cannot be known which interpreter to use.
- If it is unknown which interpreter to use, who should read the shebang line?
This looks like a chicken-egg problem.
Or is there some meta-interpreter?
Could anyone shed some light? Thanks.
file /bin/ls
shows something like/bin/ls: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2 ...
– ilkkachu Sep 19 '21 at 16:01