Leslie:

On 13.09.2016 05:35, J. Leslie Turriff wrote:
>       My original example,
>
> find . -name '*.h' | yad --list --title "Search Results"  --text "Finding all 
> header files.." --column "Files"
>
> will work when passed to bash from rexx
>
> #!/usr/bin/rexx
>  'find . -name "*.h"',
> '|yad --list',
>           '--title "Search Results"',
>           '--text "Finding all header files.."',
>           '--column "Files"',
> '|rxqueue'
>
>   do queued()
>     parse pull yad_result
>     say yad_result
>   end
> exit rc
>
> because the entire command is processed by bash.  If  I want to process the 
> results of the find command before passing them to yad
>
> #!/usr/bin/rexx
>  'find . -name "*.h"',
> '|rxqueue'
>
>   do l = 1 to queued()
>     parse pull line.l
> --   do something to line.l
> --   somehow (?) stack line. contents for yad
>   end
>
> -- how does bash know that yad should read stacked input?
>  'yad --list',
>          '--title "Search Results" ',
>          '--text "Finding all header files.."',
>          '--column "Files"',
> '|rxqueue'                                   -- get yad results
>
>   do queued()
>     parse pull yad_result
>     say yad_result
>   end
> exit rc
>
> merely SAYing them will just write them to the console, as there appears to 
> be 
> no way to tell bash to pipe them to yad.
Hmm.

If you write a Rexx program that uses the say keyword statement (or the 
LINEOUT/CHAROUT BIFs using
"stdout:" as the file name, or in ooRexx send the say-message to the .output 
monitor etc.) to output
text, then that output should go to the Unix process standard output file 
(which has a file
descriptor of 1 in each process).

Your Rexx program has no need to know whether its output will be displayed on 
the console or piped
as input to another command.

So if your Rexx program is named "helloWorld.rex" and looks like this:

    #!/usr/bin/rexx
    do i=1 to 3
          say 'hello, world #' i
     end

and you run it from the command line like this (the yad arguments may need 
adjustments):

     rexx helloWorld.rex | yad --list --title "Rexx Test Results" --text 
"Testing fetching Rexx
output..." --column "Rexx output"

you should be able to get to see the Rexx output in the yad GUI.

HTH,

---rony

> On 2016-09-12 16:24:36 Les Koehler wrote:
>> So Leslie's code would be:
>>
>> say 'some message' | yad
>>
>> and it could be done multiple times to let yad accumulate all  the text
>> and display it?
>>
>> Les


------------------------------------------------------------------------------
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to