tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Alternative to hash-bang



On Fri, 18 Jul 2014, D'Arcy J.M. Cain wrote:
Greg Troxel <gdt%ir.bbn.com@localhost> wrote:
Once --!! happens, then there will be requests to add all sorts of
things, and this seems like a mess.  Surely it's easy enough to teach

As I said, '#', ';' and '--' seem to cover most situations.  Maybe '%'
to a much smaller extent.  Can you think of many other possibilities?

Are you proposing to make the kernel recognise several new
#!-equivalents?

It would be easy, and flexible, and not especially ugly, to make the kernel scan for "#!" at some non-zero offset in the file. Say at all offsets from 0 to 4, inclusive. Then you could write up to 4 bytes to make the other interpreter think it's a comment, followed by the traditional #! stuff. If you need %%-- to make the other interpreter think the line is a comment, then write %%--#!/usr/local/bin/interpreter.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index