On Nov 15, Per Bothner wrote:
> Eli Barzilay wrote:
> > On Nov 15, Per Bothner wrote:
> >> When you need to pass extra options you can use Kawa's
> >> "--script2 FILENAME" which run the named file as a source file,
> >> skipping the first two lines. This allows:
> >>
> >> #!/bin/sh
> >> exec kawa --various --options --script2 "$0" "$_at_"
> >> (define (foo) ...)
> >> (foo ...)
> >
> > An easier solution is to ise #|...|#
> >
> > #!/bin/sh
> > #|
> > exec whatever "$0" "$_at_"
> > |#
> > ...
>
> You're right. It's so long ago that I implemented --script2 that
> I don't remember what my reason was for preferring that solution
> over yours - or whether I just didn't think of it.
>
> One disadvantage of your solution is that it is a little uglier,
> but that can be fixed if we make #!/ require an ending delimiter:
>
> #!/bin/sh
> exec whatever "$0" "$_at_"
> !#
> scheme code
Well, mine is uglier in the above, but prettier in the below.
> or:
>
> #!/usr/bin/env scheme
> !#
> scheme code
>
> The closing delimiter could be another #!, which looks nicer:
>
> #!/usr/bin/env scheme
> #!
> scheme code
(That's asking for trouble...)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
Received on Wed Nov 15 2006 - 15:38:14 UTC