[Top][All Lists]

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

[gforth] scripting

From: Anton Ertl
Subject: [gforth] scripting
Date: Wed, 23 Dec 2015 12:20:10 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Dec 22, 2015 at 07:50:49PM -0500, James Gere wrote:
> I think I read somewhere that some shells/implementations require a comment
> character in the shebang.  Gforth Manual I'm certain.

"#!" starts a comment (until the end of the line) in Gforth, and
that's there in order to allow Gforth scripts.  This means that you
have to put a space after #! (allegedly there is at least one Unix
variant that checks for "#! /", so the space is a good idea anyway).

For a .fs script, no additional flags are necessary.  If you call

bla.fs arg1 arg2

and bla.fs starts with

#! /usr/bin/gforth

this is equivalent

/usr/bin/gforth bla.fs arg1 arg2

which is probably what you want.  You can put *one* additional
argument (e.g., a flag) on the #! line; e.g., if you have the
following in bla.fs:

#! /usr/bin/gforth --die-on-signal

then the call abive is equivalent to

/usr/bin/gforth --die-on-signal bla.fs arg1 arg2

- anton

reply via email to

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