Ahh! I was missing the $$ Thanks very much!
:) "Alexander Riemer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mat, > > yes you can have the result as a Stream. Please call RUNCMD > as a function and you get the result in a %GlobalCharacterStream: > > Set Stream=$$^RUNCMD("grep strings ""logfile.txt"" | gawk '{ print $6 $8}'", 1) > Do Stream.Rewind() > Do Stream.OutputToDevice() ;or do with it whatever you want! > > Bye > Alex > > "Mat Gadd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > > oops, that didn't make any sense, did it? > > > > when i > > w ^RUNCMD("grep strings ""logfile.txt"" | gawk '{ print $6 $8}'", 0) > > it works OK, but *not* when i > > s x = ^RUNCMD("grep strings ""logfile.txt"" | gawk '{ print $6 $8}'", 1) > > > > "Mat Gadd" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
