I see, that outputs straight to screen, and I've looked in the file, I
appear to have the option to have it returned as a GlobalCharacterStream?

When I run:
 s x = ^RUNCMD("grep strings ""logfile.txt"" | gawk '{ print $6 $8}'", 1)

it works great, I get all the output in my page, but this:
 s x = ##class(%GlobalCharacterStream).%New()
 s x = ^RUNCMD("grep strings ""logfile.txt"" | gawk '{ print $6 $8}'", 1)
 d x.Rewind()
 While (x.AtEnd = 0) {
  Set len = 100
  Write x.Read(.len)
 }

Fails on the "s x = ^RUNCMD..." line...?

"Alexander Riemer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mat,
>
> for that purposes I use the attached function.
> Of course you can implement that as a classmethod
> also.
>
> In your case you could call:
>
> Write "<pre>",!
> Do ^RUNCMD("grep strings file.txt")
> Write "</pre>",!
>
> Have fun!
> Alexander Riemer
> BEWIDATA
>
> "Mat Gadd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> > Thanks! That works great! Just wondering, in a CSP file, can I display
the
> > output of the command,
> > so the user could see the output of grep?
> >
> > I've tried:
> > w $ZF(-1,"grep strings file.txt")
> >
> > which returns "0".
> >
> > "Alexander Riemer" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > If $ZF(-1,"grep and awk what you want")
> > >
> > > "Mat Gadd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > news:[EMAIL PROTECTED]
> > > > I'm looking through the documentation, looking for a way to execute
a
> > line
> > > > in a Command Prompt.
> > > >
> > > > Basically, I have a windows server with Cygwin installed, and i'm
using
> > that
> > > > to grep and awk a log file,
> > > > I wondered if I could run this and get the output in Cach�, maybe
from
> > piped
> > > > output to a file.
> > > >
> > > > Is it possible to execute external applications that haven't been
> > > > specifically written for Cach�?
> > > >
> > > > Thanks.
> > > >
> > > >  - Mat
> > > >
> > > >
> > >
> > >
> >
> >
>
>
>



Reply via email to