On 05/29/2017 09:37 PM, Kaz Kylheku (Coreutils) wrote: > With excellent language-level backward compatibility, a given > scripting language interpreter "interp" can provide support > for being invoked in the following manner: > > #!/usr/bin/env interp\000trailing material
I'm glad that hack works for you. > A possible objection is that every interpreter has to implement its > own hack for recognizing the material after the null byte Another objection: this hack FORCES the file to be treated as binary (a text file cannot contain NUL bytes), so it becomes very awkward to process the file via usual means (editors may give you grief about the embedded NUL, tools like sed, grep, and awk may corrupt your file or give you unexpected output [although the GNU tools try to allow NUL bytes where possible], and even shells may refuse to run your script because they detect a NUL byte). Not insurmountable, but worth thinking about the consequences before relying on the hack. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature