Per my previous response I didn't see Tom's response before I replied.
Tom apparently my memory is either improving or is in a holding pattern !! :)
L. A. Barnes
Tom Renz wrote:
> As stated in the "Command Interpreter Access and Variables Programmers Guide", Chapter 8; Command Input/Output Redirection (CIOR), the following applies to the use of the '>', '>>', and '<' in variables and command files:
>
> ¯-------------------------------------------------------------------------------------------------------------------
> Escaping Redirection
>
> If, for any reason, you want to use the IO redirection indicators <,> or
> >> without having them function as such, you can precede them with the !
> sign.
>
> For example, suppose you wanted to construct a command file to explain
> how to use I/O redirection which contained the following echo command:
>
> echo To redirect $STDLIST use the construct, >filename.
>
> This would cause filename to be a newly-created, temporary file
> containing the string preceding it.
>
> To prevent this from happening, insert ! before >filename, as follows:
>
> echo To redirect $STDLIST use the construct !>filename
>
> The resulting display would be:
>
> To redirect $STDLIST use the construct >filename
>
> The ! can be used in the same way to escape the other redirection
> indicators (< and >>) also.
>
> ¯---------------------------------------------------------------------------------------------------------------
>
> No need to write a COBOL program.
>
> Tom Renz
>
> >>> Lars Appel <[log in to unmask]> 08/26/99 11:18AM >>>
>
> Glenn warned...
>
> >As Stan pointed out, that doesn't always work. Before I posted
> >the command file, I tested it :) with something like
> >
> > :test "this is a test so > there"
> >
> >When I tried
> >
> > echo !stf_final
> >
> >it put a string in a temp file called "there" courtesy of the ">" above.
> >While this feature can be useful, it can also be a real hassle. I never
> >remember how to get around this, so instead of playing with it, I cheated
> >by using showvar. :)
>
> I'd probably write a small COBOL program (or whatever language of
> choice) that does an HPCIGETVAR and then DISPLAYs the result. This
> would probably get around the I/O-redirection issue with < or >.
>
> Lars.
|