Re: [Pharo-users] piping output from shell process to transcript

2015-11-24 Thread 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  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



Re: [Pharo-users] piping output from shell process to transcript

2015-11-24 Thread Thierry Goubier
2015-11-24 9:18 GMT+01:00 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.
>

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

Look at MCGitFileTreeRepository class >> #runOSProcessGitCommand:in: [
https://github.com/dalehenrich/filetree/blob/pharo5.0_dev/repository/MonticelloFileTree-Git.package/MCFileTreeGitRepository.class/class/runOSProcessGitCommand.in..st
]

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  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
>
>


Re: [Pharo-users] piping output from shell process to transcript

2015-11-23 Thread john pfersich
Try this:

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



On Mon, Nov 23, 2015 at 6:42 PM, Peter Uhnak  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
>
>


[Pharo-users] piping output from shell process to transcript

2015-11-23 Thread 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