|
|
1.1 root 1: .TH PEXEC 1P "22 June 1983"
2: .UC 4
3: .SH NAME
4: pexec \- execute command over project hierarchy
5: .SH SYNOPSIS
6: .B pexec
7: [\fB\-?ciqx\fR] [\fB\-P \fRpdirname] [\fB\-T \fRtypexpr] [\fB\-X \fRerrstatus]
8: command
9: .SH DESCRIPTION
10: .I Pexec
11: descends recursively through a project hierarchy executing
12: .I command
13: in each project directory using either the
14: .I csh
15: or
16: .I sh
17: command interpreter. The directories at each level are traversed in
18: alphabetical order.
19: .PP
20: Before executing
21: .I command
22: in each directory, the current working project is reset to the
23: project in which the directory resides.
24: .PP
25: Unless the
26: .B \-i
27: option is used,
28: .I pexec
29: quits if a directory is inaccessible or
30: .I command
31: returns a non-zero exit status. This prevents propagation of errors through
32: a project.
33: .PP
34: Care should be taken when using the characters $ * [ | ( ) and \\ in
35: the
36: .I command
37: as they are also meaningful to the command shell. It is safest to enclose
38: the entire
39: .I command
40: in single quotes.
41: .PP
42: If a
43: .I typexpr
44: boolean type label expression is specified,
45: .I pexec
46: considers only those project directories with type labels that satisfy
47: that expression.
48: The order in which the project directories are traversed depends on the
49: relative priorities of the type labels attached to each directory.
50: Only those type labels that appear in
51: .I typexpr
52: are used. Directories with labels of the same priority are sorted
53: alphabetically. For example, if the project directories `include', `cmd1',
54: `cmd2', `lib1', and `lib2' have the following labels:
55: .PP
56: .nf
57: .ta 1.0i 2.5i
58: include print.0, src, update.0, include
59: cmd1 print.1, src, update.2, cmdsrc
60: cmd2 print.1, src, update.2, cmdsrc
61: lib1 print.2, src, update.1, libsrc
62: lib2 print.2, src, update.1, libsrc
63: .DT
64: .fi
65: .PP
66: then type label expression `update' will force
67: .I pexec
68: to traverse the directories in the order `include', `lib1', `lib2', `cmd1',
69: `cmd2'.
70: .PP
71: Labels that are part of a negated expression are not used for sorting.
72: .SH OPTIONS
73: .IP \fB\-?\fR
74: Do not print ``Do you really want to quit? [yn](y):'' when interrupted in
75: foreground mode. Quit immediately.
76: .IP \fB\-c\fR
77: Instruct
78: .I csh
79: to read the `.cshrc' startup file.
80: .IP \fB\-i\fR
81: Ignore inaccessible directories and non-zero exit codes from
82: .I command.
83: .IP \fB\-q\fR
84: Quiet mode. Do not print `==>
85: .I directory
86: <==' titles.
87: .IP \fB\-x\fR
88: Trace, and print directory titles, but do not execute
89: .I command.
90: .IP "\fB\-P \fIpdirname\fR"
91: Specify a project other than the current working project. If
92: .I pdirname
93: is a project directory,
94: .I command
95: will be executed only in that directory.
96: .IP "\fB\-T \fItypexpr\fR"
97: Only execute
98: .I command
99: in project directories corresponding to boolean type label expression,
100: .I typexpr.
101: .IP "\fB\-X \fIerrstatus\fR"
102: If
103: .I pexec
104: fails, exit with status
105: .I errstatus.
106: Default error status is 1.
107: .SH EXAMPLES
108: To list all of the files in a project using
109: .I ls,
110: type:
111: .PP
112: pexec ls
113: .PP
114: If the directories containing source code have been labeled previously as
115: type `src', then, to count the total number of lines of source code in a project,
116: type:
117: .PP
118: pexec \-Tsrc \'cat *.h *.c\' | wc \-l
119: .PP
120: where quotes surround the
121: .I cat
122: command to prevent file name expansion in the
123: current directory.
124: .SH "ENVIRONMENT VARIABLES"
125: .ta \w'PROJECT'u+.5i
126: PROJECT Current working project root directory.
127: .br
128: SHELL Name of command interpreter.
129: .DT
130: .SH "SEE ALSO"
131: csh(1), sh(1)
132: .SH DIAGNOSTICS
133: If
134: .I pexec
135: is interrupted while executing
136: .I command
137: in foreground,
138: the message, ``Do you really want to quit? [yn](y):'' will appear after
139: .I command
140: has completed.
141: .PP
142: If the error message, ``pexec: \fIlabel, label \fR...: conflicting type
143: label priorities'', occurs when performing an operation on a set of
144: project directories that have been selected according to a boolean
145: type label expression with more than one type label, this indicates
146: that the directories cannot be sorted satisfactorily because of a clash
147: in priorities. For example, if project directories
148: .I a
149: and
150: .I b,
151: selected by type label expression `print\|&\|update', have
152: the following type labels:
153: .PP
154: directory a: print.1, src, update.2
155: .br
156: directory b: print.2, src, update.1
157: .PP
158: the ordering will be
159: .I ab
160: if the directories are sorted according to the
161: `print' type label, and
162: .I ba
163: if they are sorted by the `update'
164: type label. The
165: .B \-D
166: debug option can be used to dump the list of project directories that match
167: .I typexpr,
168: together with their type labels.
169: .PP
170: .I Pexec
171: returns the exit status of
172: .I command.
173: Exit status 0 is normal. Non-zero exit status indicates an error.
174: .SH AUTHOR
175: Peter J. Nicklin
176: .SH BUGS
177: The PROJECT environment variable must be defined.
178: .PP
179: Since
180: .I pexec
181: uses a separate command shell to execute
182: .I command
183: in each directory, the characters $ * [ | ( ) and \\ will be meaningful
184: to that shell even if
185: .I command
186: is protected by single quotes.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.