A small convenience update to OSProcess/CommandShell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

A small convenience update to OSProcess/CommandShell

David T. Lewis
I have updated OSProcess/CommandShell with some changes that allow
PipeableOSProcess to be used more conveniently for executing commands on
a Unix/Linux/OSX system. You can now run a simple command without worrying
about closing (pipe) file handles or other special handling. For example:

     ( PipeableOSProcess command: 'ls -l' ) output

Explanation: PipeableOSProcess was originally designed to support command
pipeline execution within a CommandShell. In that scenario, the command shell
handles all setup and cleanup of pipe handles. In practice, PipeableOSProcess
turns out to be useful for simple command execution with input and output
pipes connected to the image. The updates to PipeableOSProcess class>>command:
add the necessary setup and cleanup that would otherwise have been done by
the command shell.

OSProcess and CommandShell are on SqueakMap (select the "head" version to
get the latest), or from the squeaksource repository at:

  http://www.squeaksource.com/OSProcess
  http://www.squeaksource.com/CommandShell

Dave


Reply | Threaded
Open this post in threaded view
|

Re: A small convenience update to OSProcess/CommandShell

Chris Muller-3
A good improvement!

On Mon, Oct 6, 2014 at 6:36 PM, David T. Lewis <[hidden email]> wrote:

> I have updated OSProcess/CommandShell with some changes that allow
> PipeableOSProcess to be used more conveniently for executing commands on
> a Unix/Linux/OSX system. You can now run a simple command without worrying
> about closing (pipe) file handles or other special handling. For example:
>
>      ( PipeableOSProcess command: 'ls -l' ) output
>
> Explanation: PipeableOSProcess was originally designed to support command
> pipeline execution within a CommandShell. In that scenario, the command shell
> handles all setup and cleanup of pipe handles. In practice, PipeableOSProcess
> turns out to be useful for simple command execution with input and output
> pipes connected to the image. The updates to PipeableOSProcess class>>command:
> add the necessary setup and cleanup that would otherwise have been done by
> the command shell.
>
> OSProcess and CommandShell are on SqueakMap (select the "head" version to
> get the latest), or from the squeaksource repository at:
>
>   http://www.squeaksource.com/OSProcess
>   http://www.squeaksource.com/CommandShell
>
> Dave
>
>

Reply | Threaded
Open this post in threaded view
|

re: A small convenience update to OSProcess/CommandShell

ccrraaiigg
In reply to this post by David T. Lewis

> You can now run a simple command without worrying about closing
> (pipe) file handles or other special handling. For example:
>
>      ( PipeableOSProcess command: 'ls -l' ) output

     Thanks!


-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)