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
