This is how I implemented a "here document" ...
> #!/usr/bin/rexx
> NL = X2C('0A')
> ADDRESS "bash" "cat <<EOF" || NL || ,
> "this is line 1" || NL || ,
> "this is line 2" || NL || ,
> "this is line 3" || NL || ,
> "this is line 4" || NL || ,
> "this is line 5" || NL || ,
> "this is line 6" || NL || ,
> "this is line 7" || NL || ,
> "EOF"
--Stephen
On 09/12/2013 11:06 AM, pr gramly wrote:
> i am converting a bash script to ooRexx and am not sure how to handle
> the redirection that is used in the original in ooRexx.
>
> so the shell script is something like this:
> #!/bin/sh
> set -v
> ndmcli -x << EOJ
> submit unc0001o process snode=Z9NNODE
> pend ;
> EOJ
>
> the script invokes the ndmcli program and uses the combination of
> set -v
> i.e. "print lines of shell as they are read" which i think sends them
> to STDOUT
>
> and the
> << EOJ
> 'here document' to pass the lines to ndmcli
>
> so here is my ooRexx version:
>
> #!/usr/bin/rexx
> /* __ ooRexx __ */
>
> "ndmcli -x << EOJ" -- invoke NDM cmd line, & pass PROC stmnts
> say 'submit unc0001o process snode=Z9NNODE
> '
> say 'pend ;
> '
> say 'EOJ'
>
> Exit
>
> SAY writes to STDOUT so i thought it would work the same, but instead i
> get an error:
>
> sh: warning: here-document at line 0 delimited by end-of-file (wanted 'EOJ')
>
> so how do i pass a group of lines to another program?
>
> i looked at queuing them all up on the external data queue and using
> LINEOUT but it writes to STDOUT as well.
>
> what am i missing here?
>
> Phillip
>
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. Consolidate legacy IT systems to a single system of record for IT
> 2. Standardize and globalize service processes across IT
> 3. Implement zero-touch automation to replace manual, redundant tasks
> http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
--
--
---------------------------------------------------------------------
Stephen Y. Odo Sr Systems Programmer
Technology Infrastructure / Systems Engineering [email protected]
Information Technology Services phone: (808)956-2383
University of Hawai'i FAX: (808)956-2412
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Assistant Regional Commissioner
AYSO Honolulu Region 178 http://www.AYSOregion178.org
---------------------------------------------------------------------
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users