On 8/13/15 8:51 PM, Craig Lalley wrote:
> How do I pass the> as a string and not an operator?
It IS being passed as a string!
The "problem" is with the ECHO command, or rather, with the way the
Command Interpreter processes the the ECHO command. Your COPY_FROM
variable is dereferenced first, and only then is the ECHO executed.
So you end up with:
:ECHO awk '{$1 ="; print }' O1234.OUT.HPSPOOL > O1234
Naturally, if you look in the file called O1234 (or whatever happens to
be in your SPOOL_NBR variable), you'll find the contents to be exactly
what you told ECHO to put in there! :)
The moral of the story is if you're dealing with variables that may
contain the ">" character, you should always use SHOWVAR to view the
variable's contents, not ECHO.
Barry
On 8/13/15 8:51 PM, Craig Lalley wrote:
> SETVAR COPY_FROM,"awk '{$1 ='""; print }' " + RTRIM("!SPOOL_NBR")&
> + ".OUT.HPSPOOL " + ">" + " " + RTRIM("!SPOOL_NBR")
> ECHO !COPY_FROM
>
> It all fails with the>
> How do I pass the> as a string and not an operator?
>
> Thanks!
> -Craig
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|