I'm trying to execute python scripts automatically generated by zc.buildout so I don't have control over them. My problem is that the shebang line (#!) is too long for either bash (80 character limit) or direct execution (some Linux kernel constant I don't know).
This is an example script to help you reproduce my problem:
#!/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././bin/bash echo Hola!
How can be bash or the kernel configured to allow for bigger shebang lines?
What is bash shebang? The #! syntax is used in scripts to indicate an interpreter for execution under UNIX / Linux operating systems. The directive must be the first line in the Linux shell script and must start with shebang #! .
The shebang must be the first line because it is interpreted by the kernel, which looks at the two bytes at the start of an executable file.
It's not required and has no effect if you for example write bash ./script.sh or source the script. Shebang is only for executables, not sourced scripts.
The shebang is the combination of the # (pound key) and ! (exclamation mark). This character combination has a special meaning when it is used in the very first line of the script. It is used to specify the interpreter with which the given script will be run by default. So, if the first line of a script is: #!/bin/bash.
Limited to 127 chars on 99.9% of systems due to kernel compile time buffer limit.
It's limited in the kernel by BINPRM_BUF_SIZE
, set in include/linux/binfmts.h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With