home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: SysTools
/
SysTools.zip
/
crontab.zip
/
convert.cmd
next >
Wrap
OS/2 REXX Batch file
|
1998-01-18
|
2KB
|
56 lines
/************************************************************************/
/* install.cmd */
/* Created: 18 Jan 1998 */
/* Author: J. Pedone */
/* jpedone@flash.net */
/************************************************************************/
Call RxFuncAdd SYSLOADFUNCS, REXXUTIL, SYSLOADFUNCS
call SysLoadFuncs
Signal on Halt
tab='09'x
cr = '0d'x
lf = '0a'x
workdir = Directory()
fworkdir = workdir||'\'
arg data_file
if data_file = ' ' The Do
data_file = 'CRONTAB'
End
i = 0
do while lines(data_file) > 0
i = i+1
table.0 = i
line = linein(data_file)
parse var line table.i.minutes'/'table.i.hours'/'table.i.dates'/'table.i.months'/'table.i.days'/'table.i.years'/'table.i.session'/'table.i.file table.i.parameters
if pos('~',table.i.parameters) > 0 Then Do
table.i.type = 'Message'
temp_sep=lastpos('~',table.i.parameters)
temp_end = length(table.i.parameters)
temp_sep=temp_sep-1
table.i.file = substr(table.i.parameters,1,temp_sep)
temp_sep=temp_sep+2
table.i.parameters=substr(table.i.parameters,temp_sep,temp_end)
table.i.close = 'Yes'
table.i.workdir = ' '
table.i.session = 'Default'
End
Else Do
table.i.type = 'Program'
table.i.close = 'Yes'
temp_end=lastpos('\',table.i.file)
/* temp_end=temp_end+1 */
table.i.workdir=substr(table.i.file,1,temp_end)
End
End
Do i = 1 to table.0
If pos('#',table.i.minutes) = 0 Then Do
cron.i = table.i.minutes'≡'table.i.hours'≡'table.i.dates'≡'table.i.months'≡'table.i.days'≡'table.i.years'≡'table.i.session'≡'table.i.type'≡'table.i.file'≡'table.i.parameters'≡'table.i.workdir'≡'table.i.close
rc=lineout('newdata',cron.i)
End
End
halt:
rc = Stream('newdata','C','Close')