<div dir="ltr">I just installed the standard VM from <a href="http://squeak.org">squeak.org</a> on another computer on which I have admin privileges, and I get the exact same results (or rather absence of results), so it's not related to the fact that I used a non-completely-standard VM:<div>"OSProcess thisOSProcess stdOut nextPutAll: 'Hello world'. Smalltalk snapshot: false andQuit: true." waits forever</div><div>"Transcript show: 'Hello world'; cr. Smalltalk snapshot: false andQuit: true." terminates but does not print anything</div><div>"TranscriptStream redirectToStdOut: true. Transcript show: 'Hello world'. Smalltalk snapshot: false andQuit: true." terminates but does not print anything</div><div>"StandardFileStream stdout nextPutAll: 'Hello world'. Smalltalk snapshot: false andQuit: true." waits forever</div><div>"ExternalCommandShell start. Transcript show: 'Hello world'. ExternalCommandShell stop. Smalltalk snapshot: false andQuit: true." waits forever</div><div>"StandardFileStream stdout nextPutAll: 'Hello world'; cr; flush. Smalltalk snapshot: false andQuit: true." waits forever</div><div>"TranscriptStream redirectToStdOut: true. Transcript show: 'Hello world'. Transcript endEntry. Smalltalk snapshot: false andQuit: true." terminates but does not print anything</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-23 8:57 GMT+01:00 Jacques Harmand <span dir="ltr"><<a href="mailto:jacques.harmand@gmail.com" target="_blank">jacques.harmand@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you also for your answer!<div>Alas it doesn't work: the VM just waits forever (at least it does not execute the "Smalltalk snapshot: false andQuit: true." on the next line), and nothing is printed at all...</div><div><span style="font-size:13px">And yes, I run Squeak in the foreground without a '&' at the </span><span style="font-size:13px">end of the command line, with:</span></div><div><span style="font-size:13px">/path/to/squeak <options> /path/to/Squeak.image $(</span>readlink -f "$1")</div><div>where <options> are "-headless" or "-vm-display-null -vm-sound-null".</div><div><br></div><div>If that's important, the Squeak 5.0-201608171728 VM I use is cogspur64linux, compiled by myself, because the standard VM that can be downloaded on <a href="http://squeak.org" target="_blank">squeak.org</a> aborts with:</div><div><div>"pthread_setschedparam failed: Operation not permitted Read e.g. <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/r3732#linux" target="_blank">https://github.com/<wbr>OpenSmalltalk/opensmalltalk-<wbr>vm/releases/tag/r3732#linux</a>"</div><div>and I cannot do what is explained on that page because I'm not the admin of the computer.</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-02-23 1:47 GMT+01:00 David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jacques,<br>
<br>
Output to the standard output stream may be buffered, and that may be part<br>
of the problem. Try doing this and see if you get the expected output:<br>
<br>
  StandardFileStream stdout nextPutAll: 'Hello world'; cr; flush.<br>
<span><br>
<br>
On Wed, Feb 22, 2017 at 05:09:21PM +0100, Jacques Harmand wrote:<br>
> Thanks for your answers.<br>
> Alas ExternalCommandShell does not seem to work, the VM seems to wait<br>
> forever.<br>
<br>
</span>Be sure that you are running Squeak in the foreground with no '&' at the<br>
end of your command. If you start it in background with a '&' then the<br>
stdin, stdout, and stderr streams will be disconnected from your console,<br>
and both the image and the VM will appear to be stuck as the ExternalCommandShell<br>
tries to read from the disconnected input stream.<br>
<br>
I just tried ExternalCommandShell with the latest Squeak, and I see<br>
that it probably needs a few more #flush to get the prompt to display<br>
properly. I'll have to look into that :-)<br>
<br>
Dave<br>
<span><br>
<br>
> I also tried various other ways:<br>
> "OSProcess thisOSProcess stdOut nextPutAll: 'Hello world'."<br>
> "FileStream stdout nextPutAll: 'Hello world'."<br>
> "StandardFileStream stdout nextPutAll: 'Hello world'."<br>
> "TranscriptStream redirectToStdOut: true. Transcript show: 'Hello world'."<br>
> ... but so far none of them seems to work.<br>
> I also tried "-headless" and "-vm-display-null", but again this does not<br>
> seem to help.<br>
> Any pointer would be appreciated!<br>
><br>
> 2017-02-22 15:49 GMT+01:00 H. Hirzel <<a href="mailto:hannes.hirzel@gmail.com" target="_blank">hannes.hirzel@gmail.com</a>>:<br>
><br>
> > Maybe<br>
> ><br>
> >       ExternalCommandShell<br>
> ><br>
> >      <a href="http://wiki.squeak.org/squeak/6023" rel="noreferrer" target="_blank">http://wiki.squeak.org/squeak/<wbr>6023</a><br>
> ><br>
> > this is of some help?<br>
> ><br>
> > --Hannes<br>
> ><br>
</span><span>> > On 2/22/17, G??ran Krampe <<a href="mailto:goran@krampe.se" target="_blank">goran@krampe.se</a>> wrote:<br>
> > > On 21/02/17 20:51, Jacques Harmand wrote:<br>
> > >> Hi list,<br>
> > >> I try to use squeak to execute the following basic Smalltalk script (in<br>
> > >> a file "<a href="http://hello.st" rel="noreferrer" target="_blank">hello.st</a> <<a href="http://hello.st" rel="noreferrer" target="_blank">http://hello.st</a>>")<br>
> > >> "Transcript show: 'Hello world'; cr."<br>
> > >> from the command line with Squeak.  This works as expected with both GNU<br>
> > >> Smalltalk and Pharo, but with Squeak nothing happens: Squeak seems to<br>
> > >> wait forever.  If I add<br>
> > >> "Smalltalk snapshot: false andQuit: true."<br>
> > >> after the above line, the execution of the script terminates, but<br>
> > >> without printing anything.<br>
> > ><br>
> > > I haven't looked closely at latest Squeak (perhaps Pharo has coupled<br>
> > > Transcript to stdout for headless mode?), but Transcript is not the same<br>
> > > thing as stdout - so you wouldn't see anything on stdout.<br>
> > ><br>
</span>> > > regards, G??ran<br>
<div class="m_-916644823227204715HOEnZb"><div class="m_-916644823227204715h5">> > > ______________________________<wbr>_________________<br>
> > > Beginners mailing list<br>
> > > <a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
> > > <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
> > ><br>
> > ______________________________<wbr>_________________<br>
> > Beginners mailing list<br>
> > <a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
> > <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
> ><br>
<br>
> ______________________________<wbr>_________________<br>
> Beginners mailing list<br>
> <a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundati<wbr>on.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>