#1=$1 2=$2  3=$3 4=$4 5=$5 6=$6 7=$7
#(ZZZZETC) ZZZZETC 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=AT  6=out_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=COPY_DB_LOG_M 6=out_file 7=i_drive 8=in_path 9=in_file   
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=DIR 6=out_file 7="dir" 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=ERASE 6=erase_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=ERASE_LOG 6=erase_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=ERASE_TIME 6=hh.mm 7=pid 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=ERASE_MESSAGE 6=message_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=EXIST_MESSAGE 6=out_file 7=exist_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=TYPE_ERROR_TIME 6=out_file 
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=WRITE_MESSAGE 6=message_file 7=color 8="message" 9=HALT  
#1=sys_lang 2={REAL,TEST} 3=system 4=job 5=SETUP_CLIENT 6=lang 7=timeout_connect 8="timeout_sql 9=server 10=menu 11="title"  
if test '$6' = '';then exit 1;fi
if test ! '$2' = 'REAL';then exit 1;fi
#===( AT 6=out_file )===
if test '$5' = 'AT';then AT > ./$6;exit 0;fi
#===( COPY_DB_LOG_M 6=out_file 7=i_drive: 8=in_path 9=in_file)===
if test '$5' = 'COPY_DB_LOG_M'
 then cp "$7/Program Files/Microsoft SQL Server/$8/$9" ./$6
exit 0;fi
# ===( DIR 6=out_file,7=dir )===
if test '$5' = 'DIR'
   then if test '$7' = '';then exit 1;fi
        ls -al $7 > ./$6
exit 0;fi
# ===( DIR_LOG 6=out_file,7=dir )===
if test '$5' = 'DIR_LOG' GOTO DIR_LOG
  then if test '$7' = '';then exit 1;fi
   ls -al /home/I/FILE/$3.I/$2/LOG/$7" > ./$6
exit0;fi
REM ===( ERASE 6=erase )===
if test '$5' = 'ERASE';then if test -f ./$6;then rm ./$6;fi;exit 0;fi
# ===( ERASE_LOG 6=erase_log )===
if test '$5' = 'ERASE_LOG'
  then if test -f /home/I/FILE/$3.I/$2/LOG/$6
          then rm /home/I/FILE/$3.I/$2/LOG/$6;fi;exit 0;fi
# ===( ERASE_TIME 6=time,7=pid )===
if test '$5' = 'ERASE_TIME'
  then  if test ! -f /home/I/FILE/SHARE/MESSAGE/$1.$2.$3.$6*.TIME
  then if test '$7' = '';then exit 1;fi
    at $7 /DELETE ;fi;exit 0;fi
    rm /home/I/FILE/SHARE/MESSAGE/$1.$2.$3.$6*.TIME
exit 0;fi
# ===( ERASE_MESSAGE 6=message_file )===
if test '$5' = 'ERASE_MESSAGE'
 then if teat -f /home/I/FILE/SHARE/MESSAGE/%2.%6 
         then rm /home/I/FILE/SHARE/MESSAGE/%2.%6;fi  
exit 0;fi
# = =( EXIST_MESSAGE 6=out_file,7=message_file ) = =
if test '$5' = 'EXIST_MESSAGE'
 then if test '$7' = '';then exit 1;fi
 if test -f /home/I/FILE/SHARE/MESSAGE/$2.$7 GOTO EXIST_MESSAGE_J
    then echo !!! FOUND > ./$6
    else echo NOT FOUND > ./$6;fi
exit 0;fi
# = =( TYPE_ERROR_TIME 6=out_file ) = =
if test '$5' = 'TYPE_ERROR_TIME'
then if test ! -f /home/I/FILE/SHARE/MESSAGE/*ERR.TIME
      then echo ERROR TIME NOT FOUND > ./$6
      else cat /home/I/FILE/SHARE/MESSAGE/*ERR.TIME | SORT /+20 > ./$6;fi 
exit 0;fi
# = =( WRITE_MESSAGE 6=message_file 7=color 8=message 9=HALT ) = =
if test '$5' = 'WRITE_MESSAGE'
then if test '$8' = '';then exit 1;fi 
echo $7 $8 $3 > /home/I/FILE/SHARE/MESSAGE/$2.$6
if test '$9' = 'HALT';
then mono /home/I/BIN/I6MENUU.EXE $1 /home/I/BIN/I6_HALT.TXT ZZ_ARG_FILE=/home/I/FILE/SHARE/MESSAGE/$2.$6
# = =( WRITE_MESSAGE 6=message_file 7=color 8=message 9=HALT ) = =
# == ( SETUP_CLIENT )1=system 2=job 3=SETUP_CLIENT 4=lang
# 5=timeout_connect 6=timeout_sql 7=server 8=menu 9="title"  
if test '$5' = 'SETUP_CLIENT'
 then SHIFT;SHIFT
 echo ./CLIENT/CLIENT CLIENT $4 $5 $6 $7_$1.I $8 $9 > /home/I/FILE/SHARE/UNIX/SETUP_$1_$4_$8 
 echo CALL CLIENT/CLIENT.BAT CLIENT $4 $5 $6 $7_$1.I $8 $9 > /home/I/FILE/SHARE/WINDOWS/SETUP_$1_$4_$8.BAT 
exti0;fi
