I have a script that I dont know what it is doing. Can any one tell me what this script is doing? Please? here is the script with the lines numbered.
1 #!usr/bin/ksh
2 date +%m%d%y%H%M >invdte
3 exec <invdte
4 read dte
5 cp /test/appl_from/810S /test/appl_from/810S-$dte.jic
6 cp /test/appl_from/base810S /test/appl_from/A3810S
7 cp /test/appl_from/base810S /test/appl_from/3M810S
8 >810a.wrk
9 sig="XX"
10 A3=" "
11 fil="XX"
12 t=0
13 usxx=0
14 usab=0
15 us3M=0
16 id[300]="end"
17 cat /test/appl_from/810S |tr "|" "11" >810a.wrk
18 exec <810a.wrk
19 while read a b c d e f g h i j
20 do
21 ((t=t+1))
22 if test "$a" = "ENV"
23 then
24 echo "$g $e"
25 if test "$h" = "X12"
26 then sig="$g"
27 fi
28 fi
29 id[$t]="$sig"
30 done
31
32 exec </test/appl_from/810S
33 t=0
34 while read a
35 do
36 ((t=t+1))
37 fil="XX"
38 usxx=1
39 if test ${id[$t]} = "ABBOTT"
40 then fil="A3"
41 usab=1
42 fi
43 if test ${id[$t]} = "3M"
44 then fil="3M"
45 us3m=1
46 fi
47 echo $a >>/test/appl_from/"$fil"810S
48 if test "$fil" = "XX"
49 then
50 echo "cannot assign inv for ${id[$t]}"
51 fi
52 done
53
54 if test $usab = "1"
55 then
56 echo "A3 file exists"
57 fi
58
59 if test "$us3M" = "1"
60 then
61 echo "3M file exists"
62 fi
63 mv /test/appl_from/810S /test/appl_from/810S-"$dte".fil
64 exit