Fwd: Re: [squeak-dev] Using OSProcess

Casimiro de Almeida Barreto casimiro.barreto at gmail.com
Fri Nov 19 17:37:11 UTC 2010


Em 19-11-2010 15:22, Casimiro de Almeida Barreto escreveu:
> Em 19-11-2010 15:00, Mike Hales escreveu:
>> I must be missing something obvious, but how can I get the results of
>> executing an external command. 
>>
>> OSProcess command: 'ls /etc'
> Try:
>
> | pc1 |
>
>     pc1 := (PipeableOSProcess command: 'ls -l' ) output.
>
>     Transcript show: pc1.
Oooopsss... error:

    Transcript show: pc1 upToEnd.

Or else:

    Transcript show: (PipeableOSProcess command: 'ls -l') upToEnd; cr.
>>
>> returns me an ExternalUnixProcess. I just want a string of the
>> command results. This seems to basic to be hard, but I'm stumped. In
>> VisualWorks and GemStone this is just a one liner.
>>
>> Thanks,
>>
>> Mike
>>
>>
>>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20101119/da8de4df/attachment.htm


More information about the Squeak-dev mailing list