[Top][All Lists]

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

Re: [gforth] Using Gforth with #! "shebang"

From: Anton Ertl
Subject: Re: [gforth] Using Gforth with #! "shebang"
Date: Wed, 21 Nov 2012 14:59:00 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Nov 21, 2012 at 04:44:25AM +0100, David Kuehling wrote:
> Hi,
> I just realized that I cannot set dictionary size, stack size etc. when
> using Gforth from scripts via #!, as #! on Linux only supports passing
> of a single argument to the interpreter:
> A file starting with:
> #! /usr/local/bin/gforth-fast -m 256M -d 4M -r 4M -l 256k
> produces error:
> /usr/local/bin/gforth-fast: cannot grok size specification  256M -d 4M -r 4M 
> -l 256K: invalid unit "M -d 4M -r 4M -l 256K"

Looks to me like it passes two arguments: "-m" and "256M -d 4M -r 4M
-l 256k".  Given that, we could add another command-line option -#!
that parses the next argument and treats it as a sequence of
command-line arguments.  Then you could write the line as follows:

#! /usr/local/bin/gforth-fast -#! -m 256M -d 4M -r 4M -l 256k

However, I think that there are Unixes that ignore everything after
the first argument, so this approach would not work there.

- anton

reply via email to

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