views:

281

answers:

4

How can you invoke shell commands from Squeak and Pharo? Do these environments have anything in them like the system() function in certain unix languages to run external shell commands, or the backticks (can't make them here do to the editor, but what you get when you push the key left of "1" and above "TAB") to capture the output of commands?

+3  A: 

In Squeak you can use CommandShell, but I don't know what (if anything) is available for Pharo at this time.

Alex Martelli
+3  A: 

I think you can use the package OSProcess to do what you want. In addition, I think is better to ask in squeak-dev or pharo mailing list.

Mariano
http://www.squeaksource.com/OSProcess/
Damien Cassou
+2  A: 

Shell support in Squeak/Pharo is pretty limited. There are plans to get this improved, you're contributions are welcome.

Adrian
+1  A: 

You have two solutions:

Use the package ProcessWrapper. Pros: quick and easy install. Cons: limited functionality, only on win32.

Use the package OSProcess/CommandShell. Pros: pretty good functionality (pipes, environment vars, shell-like workspace ...), and cross platform. Cons: must use VMMaker tools to build the external plugin.

Gabriel Cuvillier