4 ms·
How/why does this work without "#!" at the beginning of the file? I just tested with fish shell, and I get "Exec format error. The file './x' is marked as an ex
by scintill76 11y ago
How/why does this work without "#!" at the beginning of the file? I just tested with fish shell, and I get "Exec format error. The file './x' is marked as an executable but could not be run by the operating system." But, from bash or dash it does execute commands from the file.
- Tiksi 11y agoIt'll fall back to sh, the default shell (or whatever it's symlinked to): http://paste.click/QxWUMG http://paste.click/QxWUMG In my case that's bash, debian based systems use dash.
- cyphar 11y agoThat shouldn't happen if you look at fs/exec.c (search_binary_handler) there isn't a "fallback to shell" option. And fs/binfmt_script.c doesn't fall back to shell either. Are you sure you don't have some weird binfmt_misc hook enabled?
- JdeBP 11y agoThe "it" in what you are replying to is not the kernel; but the shell. * http://pubs.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_009_001_001 http://pubs.opengroup.org/onlinepubs/007908799/xcu/chap2.htm... * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3...