1CLASSAD_EVAL(1) HTCondor Manual CLASSAD_EVAL(1)
2
3
4
6 classad_eval - HTCondor Manual
7
8 Evaluate the given ClassAd expression(s) in the context of the given
9 ClassAd attributes, and prints the result in ClassAd format.
10
11
12
13
15 classad_eval -help
16
17 classad_eval [-[ad]-file <file-name>] [-target-file <file-name>] <ad |
18 assignment | expression | -quiet>+
19
21 classad_eval is designed to help you understand and debug ClassAd ex‐
22 pressions. You can supply a ClassAd on the command-line, or via a
23 file, as context for evaluating the expression. You may also construct
24 a ClassAd one argument at a time, with assignments.
25
26 By default, classad_eval will print the ClassAd context used to evalu‐
27 ate the expression before printing the result of the first expression,
28 and for every expression with a new ClassAd thereafter. You may sup‐
29 press this behavior with the -quiet flag, which replaces an ad, assign‐
30 ment, or expression, and quiets every expression after it on the com‐
31 mand line.
32
33 Attributes specified on the command line, including those specified as
34 part of a complete ad, replace attributes in the context ad, which
35 starts empty. You can't remove attributes from the context ad, but you
36 can set them to undefined.
37
38 Options, flags, and arguments may be freely intermixed, and take effect
39 in order.
40
41 Note that classad_eval uses the new ClassAd syntax: ClassAds specified
42 in a file must be surrounded by square brackets and attribute-value
43 pairs must be separated by semicolons. For compability with condor_q
44 -long:new and condor_status -long:new, classad_eval will use only the
45 first ClassAd if passed a ClassAd list of them.
46
48 Almost every ad, assignment, or expression will require you to single
49 quote them. There are some exceptions; for instance, the following two
50 commands are equivalent:
51
52 $ classad_eval 'a = 2' 'a * 2'
53 $ classad_eval a=2 a*2
54
55 You can specify attributes for the context ad in three ways:
56
57 $ classad_eval '[ a = 2; b = 2 ]' 'a + b'
58 $ classad_eval 'a = 2; b = 2' 'a + b'
59 $ classad_eval 'a = 2' 'b = 2' 'a + b'
60
61 You need not supply an empty ad for expressions that don't reference
62 attributes:
63
64 $ classad_eval 'strcat("foo", "bar")'
65
66 If you want to evaluate an expression in the context of the job ad,
67 first store the job ad in a file:
68
69 $ condor_q -l:new 1227.2 > job.ad
70 $ classad_eval -quiet -file job.ad 'JobUniverse'
71
72 You can extract a machine ad in a similar way:
73
74 $ condor_status -l:new slot1@exec-17 > machine.ad
75 $ classad_eval -quiet -file machine.ad 'Rank'
76
77 You may evaluate an expression in order to check a match by using the
78 -target-file option:
79
80 $ condor_q -l:new 1227.2 > job.ad
81 $ condor_status -l:new exec-17 > machine.ad
82 $ classad_eval -quiet -my-file job.ad -target-ad machine.ad 'MY.requirements' 'TARGET.requirements'
83
84 Assignments (including whole ClassAds) are all merged into the context
85 ad:
86
87 $ classad_eval 'x = y' 'x' 'y = 7' 'x' '[ x = 6; z = "foo"; ]' 'x'
88 [ x = y ]
89 undefined
90 [ y = 7; x = y ]
91 7
92 [ z = "foo"; x = 6; y = 7 ]
93 6
94
95 You can suppress printing the context ad partway through:
96
97 $ classad_eval 'x = y' 'x' -quiet 'y = 7' 'x' '[ x = 6; z = "foo"; ]' 'x'
98 [ x = y ]
99 undefined
100 7
101 6
102
104 Returns 0 on success.
105
107 Center for High Throughput Computing, University of Wisconsin-Madison
108
110 Copyright © 1990-2019 Center for High Throughput Computing, Computer
111 Sciences Department, University of Wisconsin-Madison, Madison, WI. All
112 Rights Reserved. Licensed under the Apache License, Version 2.0.
113
115 HTCondor Team
116
118 1990-2023, Center for High Throughput Computing, Computer Sciences De‐
119 partment, University of Wisconsin-Madison, Madison, WI, US. Licensed
120 under the Apache License, Version 2.0.
121
122
123
124
125 Oct 02, 2023 CLASSAD_EVAL(1)