HP3000-L Archives

November 1997, 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:
Wolfgang Kinscher <[log in to unmask]>
Reply To:
Date:
Tue, 11 Nov 1997 18:54:49 +0100
Content-Type:
text/plain
Parts/Attachments:
Re: (59 lines)
8< ----------------------------
)This is not "better", I just wanted to point out that repl() exists
)and could be useful for doubling CI metacharacters in lines that
)you may be echoing to a file.
)
)Jeff Vance, CSY
)
)--

... and the evaluator function repl makes it possible to avoid
unwanted variable dereference in lines 2/last of the job file;
our script can look as follows
(must be on MPE/iX 5.5):

parm _job,char='!',AT='',day='',date='', in='',_step='STEP1'
if '!_step' = 'STEP1' then
   xeq !hpfile  '!_job', _step='STEP2'  <!_job
   setvar timespec ' '
   if '!at' > ' '
     setvar timespec ';AT=' + '!AT'
    endif
   if '!day' > ' '
     setvar timespec timespec + ';DAY=' + '!DAY'
    endif
   if '!date' > ' '
     setvar timespec timespec + ';DATE=' + '!DATE'
    endif
   if '!in' > ' '
     setvar timespec timespec + ';IN=' + '!IN'
    endif
   reset tempjob
   stream tempjob,!char !timespec
   purge tempjob,temp
   deletevar _l, _nrecs, timespec
else
if '!_step' = 'STEP2' then
   file tempjob=tempjob,oldtemp
   if finfo('*tempjob','exists') then
      purge tempjob,temp
   endif
   file tempjob;temp;disc=![finfo('!_job','end of file')]
   fcopy from=!_job;to=*tempjob;new;subset=0,0  > $null
   file tempjob=tempjob,oldtemp
   setvar _nrecs finfo('!_job','end of file')
   input _l
   setvar _nrecs, _nrecs-1
   if str(_l,1,1) = '!' then
      setvar _l '!' + _l
   endif
   echo !_l >*tempjob
   while _nrecs > 0 do
      input _l
      setvar _nrecs, _nrecs-1
      setvar _l repl(_l,'!','!!')
      echo !_l>>*tempjob
   endwhile
endif
endif

ATOM RSS1 RSS2