[squeak-dev] Running Squeak fro ma unix shell script file with #! squeak...

tim Rowledge tim at rowledge.org
Mon May 6 22:53:30 UTC 2019


Some interesting success on the Pi now; with latest updates for Dave's 'ignore the hashbang' and turning off the deprecation warning. 

I'm not sure why my earlier attempts failed since so far as I can see they should have worked. Maybe I got some strange char in the file that wasn't visible?

Anyway there are several functional scenarios
+++++++++++++
#!/usr/bin/squeak --

FileStream stdout
	nextPutAll: 'hello world'; 
	cr.
Smalltalk snapshot: false andQuit: true
++++++++++
will run and expects to find the 'squeak.image' in the CWD or as specified by the SQUEAK_IMAGE environment variable.
The -- is required in order to let the vm know you are not trying to run an image named as the script file.

+++++++++++++
#!/usr/bin/squeak /home/pi/Squeak/my.image

FileStream stdout
	nextPutAll: 'hello world'; 
	cr.
Smalltalk snapshot: false andQuit: true
++++++++++
also works as long as you don't also have the -- (because that makes the vm try to find an image named "my.image --", which seems like a parsing rule that might be improvable)

The remaining problem is that any attempt to include any option (say #!/usr/bin/squeak -fullscreen --) confuses things as it leads to the vm being unable to recognise any of the options. 
The weird bit is that the final command is -
LD_LIBRARY_PATH=/usr/lib/squeak/5.0-201610101924:/lib/arm-linux-gnueabihf:/lib:/usr/lib/arm-linux-gnueabihf:/usr/lib: /usr/lib/squeak/5.0-201610101924/squeak -fullscreen /home/pi/Squeak/squeak.image ./HelloWorld.st

... and the errors starts off with -
unknown option: -fullscreen /home/pi/Squeak/squeak.image
Usage: /usr/lib/squeak/5.0-201610101924/squeak [<option>...] [<imageName> [<argument>...]]
       /usr/lib/squeak/5.0-201610101924/squeak [<option>...] -- [<argument>...]
... which looks pretty odd since that describes what it got. Very odd.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Manual Writer's Creed:  Garbage in, gospel out.




More information about the Squeak-dev mailing list