HP3000-L Archives

August 2015, Week 2

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:
Barry Lake <[log in to unmask]>
Reply To:
Barry Lake <[log in to unmask]>
Date:
Thu, 13 Aug 2015 21:59:57 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
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 *

ATOM RSS1 RSS2