1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#{ MKBATCH -- Make a batch script.
{
# Make a copy of the script file query parameter and delete the
# file if it exists and not appending.
scrpt = script
if (access (scrpt) && !append)
delete (scrpt, verify=verify)
# Outer loop provides return when the user wants to start over.
while (YES) {
# Add commands until the user is done.
while (YES) {
# Determine the task name and check that it is loaded.
ltask = task
if (!deftask (ltask)) {
print ("Task ", ltask, " not loaded.")
next
}
# Edit the task parameters.
eparam (ltask)
print ("")
# If the user is verifying then display the command.
if (verify) {
lparam (ltask) | cmdstr (ltask, hidden=hidden)
cok = YES
if (cok) {
lparam (ltask) | cmdstr (ltask, hidden=hidden, >> scrpt)
print ("", >> scrpt)
}
} else {
lparam (ltask) | cmdstr (ltask, hidden=hidden, >> scrpt)
print ("", >> scrpt)
}
# Ask if more commands are to be added to the script.
more = YES
if (!more)
break
}
# If verifying page the script and let the user decide to start
# over.
if (verify) {
page (scrpt)
sok = YES
if (sok)
break
else
delete (scrpt, verify=verify)
} else
break
}
# If the user does not want to submit the script then quit.
if (!submit)
bye
}
# Submit the script as a background process.
print ("Script ", scrpt, " submitted at:")
time
print ("\nScript ", scrpt, " submitted at:", >> logfile)
time (>> logfile)
cl (< scrpt, >>& logfile) &
|