piping output from shell process to transcript

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

piping output from shell process to transcript

Peter Uhnak
Hi,

how can I pipe output from PipeableOSProcess to Transcript?

I tried doing:

(PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.

However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
and even if it would, the output is delivered there at the end anyway.

I would like to see the live result of the running commands.

Thanks,

--
Peter

Reply | Threaded
Open this post in threaded view
|

Re: piping output from shell process to transcript

John Pfersich
Try this:

| p |
p:= (PipeableOSProcess waitForCommand: 'whoami').
Transcript show: (p output).



On Mon, Nov 23, 2015 at 6:42 PM, Peter Uhnak <[hidden email]> wrote:
Hi,

how can I pipe output from PipeableOSProcess to Transcript?

I tried doing:

(PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.

However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
and even if it would, the output is delivered there at the end anyway.

I would like to see the live result of the running commands.

Thanks,

--
Peter


Reply | Threaded
Open this post in threaded view
|

Re: piping output from shell process to transcript

Peter Uhnak
On 11/23, john pfersich wrote:
> Try this:
>
> | p |
> p:= (PipeableOSProcess waitForCommand: 'whoami').
> Transcript show: (p output).

This will not do, as I said, I need live result. `#output` will output
it only after the process has completed.

>
>
>
> On Mon, Nov 23, 2015 at 6:42 PM, Peter Uhnak <[hidden email]> wrote:
>
> > Hi,
> >
> > how can I pipe output from PipeableOSProcess to Transcript?
> >
> > I tried doing:
> >
> > (PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.
> >
> > However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
> > and even if it would, the output is delivered there at the end anyway.
> >
> > I would like to see the live result of the running commands.
> >
> > Thanks,
> >
> > --
> > Peter
> >
> >

--
Peter

Reply | Threaded
Open this post in threaded view
|

Re: piping output from shell process to transcript

Thierry Goubier


2015-11-24 9:18 GMT+01:00 Peter Uhnak <[hidden email]>:
On 11/23, john pfersich wrote:
> Try this:
>
> | p |
> p:= (PipeableOSProcess waitForCommand: 'whoami').
> Transcript show: (p output).

This will not do, as I said, I need live result. `#output` will output
it only after the process has completed.

I can only suggest some of the code GitFileTree uses; with a delay loop to retrieve continuously the output.


It's a low-level use of OSProcess, but it is fairly reliable.

Thierry
 

>
>
>
> On Mon, Nov 23, 2015 at 6:42 PM, Peter Uhnak <[hidden email]> wrote:
>
> > Hi,
> >
> > how can I pipe output from PipeableOSProcess to Transcript?
> >
> > I tried doing:
> >
> > (PipeableOSProcess command: 'my-command.sh') outputOn: Transcript.
> >
> > However `#outputOn:` doesn't send `#endEntry` so I don't see anything,
> > and even if it would, the output is delivered there at the end anyway.
> >
> > I would like to see the live result of the running commands.
> >
> > Thanks,
> >
> > --
> > Peter
> >
> >

--
Peter