Squeak scripts in UNIX

Matej Kosik kosik at fiit.stuba.sk
Tue Feb 13 14:21:56 UTC 2007


Friends,

I would like to update the manual page of Squeak (its SCRIPTS section is
out of date). At least for the Debian packages.

Now, the Squeak script to be executed must be specified as URI, not an
ordinary path. That means that it is not possible to rely on the
traditional (and handy) feature of UNIX kernels that if the user tries
to execute a file that begins with `#' (shebang) character, the kernel
actually runs the program specified in that first line and appends the
filename that is actually executed as a last parameter to that program.

This is what everybody knows. However, if Squeak requires URI instead of
path, it is actually not possible to create Squeak scripts. Is this
true? What should be inside the SCRIPTS section in the manual page?

I know that using Squeak for scripts seems to be retrogressive, but I
have used it once and then it helped me much.

Work in progress (with mistakes) is here
http://altair.dcs.elf.stuba.sk/~kosik/tmp/squeakvm.html

The SCRIPTS section is empty, now. The original text is very nice and
simple, but also wrong.
----------------------------------------
Here is the most simple way how a Hello, world script could look like

f := FileStream fileNamed: '/dev/stdout'.
f nextPutAll: 'Hello, world'.
f nextPut: Character lf.
SmalltalkImage current snapshot: false andQuit: true

It, unfortunatelly, cannot be run normally via shebang but it must be
run as follows

squeak -vm display=null -vm sound=null $SQUEAK_IMAGE file://`pwd`/hello.st

Seems quite terrible. Isn't there a simpler way?
-- 
Matej Kosik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070213/4de5f840/signature.pgp


More information about the Squeak-dev mailing list