[squeak-dev] Console smalltalk program.

David T. Lewis lewis at mail.msen.com
Fri Mar 19 03:28:45 UTC 2010

On Thu, Mar 18, 2010 at 11:15:10PM -0300, Adrian Norberto Marino wrote:
> Thanks for all!
> First of all apologies for my low level of English.
> I Found a way to execute smalltak code from a squeak image
> from unix bash that was what he needed, Of the next form:
> 1. evaluate "ExternCommandShell start" from squeak image.
> 2. Close squeak image
> 3. run from unix shell(bash): squeak -headless myImage
> 4. This open a sqsh interpreter.
> 4. Now run by example: Array with: 'Helo'
> it possible execute a squeak smalltalk expression of the next way?
> bash$  squeak -headless myImage  Array with: 'Helo'
> my idea is execute a smalltalk espression directly desde bash.

Instead of putting the Smalltalk expression on the command line,
you can send it to stdin like this:

  bash$ echo "Array with: 'Helo' ! ; exit" | squeak -headless myImage

The $! after the Smalltalk expression means interpret the expression
as a Smalltalk doIt instead of as Unix command.

ExternalCommandShell will evaluate "Array with: 'Helo' !" as a
Smalltalk expression and print the result on console. Then it
evaluates "exit" as a command, and the Squeak image will exit.


p.s. Your English is good enough!

More information about the Squeak-dev mailing list