help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] shebang for language that does not use # for comment


From: Bob Proulx
Subject: Re: [Help-bash] shebang for language that does not use # for comment
Date: Tue, 3 Jul 2012 17:01:10 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

Peng Yu wrote:
> For languages that do not use # as commend symbol, I have some trouble
> for using the shebang line (see the annoy error message).

If the interpreter does not use '#' for comments then using the
shebang line ('#!') to launch it is unsuitable.  You should find a
different method for invoking it.

> Since the shebang line is not supposed to be used by the interpreter
> why not strip it off before the file is passed to the interpreter?

The interface was designed for use by shell scripts.  Shell scripts
use '#' as a comment which was specifically why that character was
chosen.  It has never stripped that line before and doing so now would
break existing scripts.  Perl for example makes use of that information.

The actual mechanics of the "#!" implementation is a kernel function.
It has nothing to do with bash.  The kernel implements the exec(2)
interface.  To change this you would need to take it up on a kernel
mailing list.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]