I tried to install Squeak/Pharo into Ubuntu serv开发者_开发技巧er machine.
./squeak -vm-display-null ./Pharo-1.2.2-12353/Pharo-1.2.image
It executed, but there was no command-line. No way to use without GUI?
Have a look at Coral, it provides a scripting interface to Pharo. Not sure where to find up-to-date documentation, but there is a build on the Pharo Build Server.
You can send scripts by parameter to the VM.
./squeak -vm-display-null ./Pharo-1.2.2-12353/Pharo-1.2.image myScript.st
But that's all you can do apart from Coral. Otherwise you should use GNUSmalltalk
I believe in the current VM you have to use a full "file:///" URL, a choice made a while back and only recently having been discussed as wanting to be reversed.
I am not sure if I understand your needs correctly, but I guess you could write a few liner read-eval loop, and pass it as script argument at start up.
Other than that most headless usages of smalltalk are for web servers (seaside, aida), in which case there is usually an admin url which lets you to poke around image by sending messages to objects and similar. If you have seaside one click image you could try out:
http://localhost:8080/tools/classbrowser
http://localhost:8080/tools/screenshot
http://localhost:8080/tools/versionuploader
to give you a taste of what can be done.
There is Coral, but you might also look into a lighter version of Pharo called "Pharo Kernel":
Pharo Kernel is a small Smalltalk kernel that is stripped down from Pharo Core image. Meanwhile there is also a 3MB Pharo-Kernel-Gofer image available that has networking support and Gofer (a pharo installer to load packages) installed.
Check it out at https://ci.inria.fr/pharo-contribution/view/Pharo-Kernel-2.0/job/PharoKernel2.0/
精彩评论