HP3000-L Archives

August 1999, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Renz <[log in to unmask]>
Reply To:
Date:
Thu, 26 Aug 1999 10:52:19 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (58 lines)
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.

ATOM RSS1 RSS2