Debian Codegraph @

upstream/opensuse-tumbleweed/man3/ExtUtils::Command.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "ExtUtils::Command 3pm"
61 .TH ExtUtils::Command 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 ExtUtils::Command \- utilities to replace common UNIX commands in Makefiles etc.
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 12
71 \& perl \-MExtUtils::Command \-e cat files... > destination
72 \& perl \-MExtUtils::Command \-e mv source... destination
73 \& perl \-MExtUtils::Command \-e cp source... destination
74 \& perl \-MExtUtils::Command \-e touch files...
75 \& perl \-MExtUtils::Command \-e rm_f files...
76 \& perl \-MExtUtils::Command \-e rm_rf directories...
77 \& perl \-MExtUtils::Command \-e mkpath directories...
78 \& perl \-MExtUtils::Command \-e eqtime source destination
79 \& perl \-MExtUtils::Command \-e test_f file
80 \& perl \-MExtUtils::Command \-e test_d directory
81 \& perl \-MExtUtils::Command \-e chmod mode files...
82 \& ...
83 .Ve
84 .SH DESCRIPTION
85 .IX Header "DESCRIPTION"
86 The module is used to replace common UNIX commands. In all cases the
87 functions work from \f(CW@ARGV\fR rather than taking arguments. This makes
88 them easier to deal with in Makefiles. Call them like this:
89 .PP
90 .Vb 1
91 \& perl \-MExtUtils::Command \-e some_command some files to work on
92 .Ve
93 .PP
94 and \fINOT\fR like this:
95 .PP
96 .Vb 1
97 \& perl \-MExtUtils::Command \-e \*(Aqsome_command qw(some files to work on)\*(Aq
98 .Ve
99 .PP
100 For that use Shell::Command.
101 .PP
102 Filenames with * and ? will be glob expanded.
103 .SS FUNCTIONS
104 .IX Subsection "FUNCTIONS"
105 .IP cat 4
106 .IX Item "cat"
107 .Vb 1
108 \& cat file ...
109 .Ve
110 .Sp
111 Concatenates all files mentioned on command line to STDOUT.
112 .IP eqtime 4
113 .IX Item "eqtime"
114 .Vb 1
115 \& eqtime source destination
116 .Ve
117 .Sp
118 Sets modified time of destination to that of source.
119 .IP rm_rf 4
120 .IX Item "rm_rf"
121 .Vb 1
122 \& rm_rf files or directories ...
123 .Ve
124 .Sp
125 Removes files and directories \- recursively (even if readonly)
126 .IP rm_f 4
127 .IX Item "rm_f"
128 .Vb 1
129 \& rm_f file ...
130 .Ve
131 .Sp
132 Removes files (even if readonly)
133 .IP touch 4
134 .IX Item "touch"
135 .Vb 1
136 \& touch file ...
137 .Ve
138 .Sp
139 Makes files exist, with current timestamp
140 .IP mv 4
141 .IX Item "mv"
142 .Vb 2
143 \& mv source_file destination_file
144 \& mv source_file source_file destination_dir
145 .Ve
146 .Sp
147 Moves source to destination. Multiple sources are allowed if
148 destination is an existing directory.
149 .Sp
150 Returns true if all moves succeeded, false otherwise.
151 .IP cp 4
152 .IX Item "cp"
153 .Vb 2
154 \& cp source_file destination_file
155 \& cp source_file source_file destination_dir
156 .Ve
157 .Sp
158 Copies sources to the destination. Multiple sources are allowed if
159 destination is an existing directory.
160 .Sp
161 Returns true if all copies succeeded, false otherwise.
162 .IP chmod 4
163 .IX Item "chmod"
164 .Vb 1
165 \& chmod mode files ...
166 .Ve
167 .Sp
168 Sets UNIX like permissions \*(Aqmode\*(Aq on all the files. e.g. 0666
169 .IP mkpath 4
170 .IX Item "mkpath"
171 .Vb 1
172 \& mkpath directory ...
173 .Ve
174 .Sp
175 Creates directories, including any parent directories.
176 .IP test_f 4
177 .IX Item "test_f"
178 .Vb 1
179 \& test_f file
180 .Ve
181 .Sp
182 Tests if a file exists. \fIExits\fR with 0 if it does, 1 if it does not (ie.
183 shell\*(Aqs idea of true and false).
184 .IP test_d 4
185 .IX Item "test_d"
186 .Vb 1
187 \& test_d directory
188 .Ve
189 .Sp
190 Tests if a directory exists. \fIExits\fR with 0 if it does, 1 if it does
191 not (ie. shell\*(Aqs idea of true and false).
192 .IP dos2unix 4
193 .IX Item "dos2unix"
194 .Vb 1
195 \& dos2unix files or dirs ...
196 .Ve
197 .Sp
198 Converts DOS and OS/2 linefeeds to Unix style recursively.
199 .SH "SEE ALSO"
200 .IX Header "SEE ALSO"
201 Shell::Command which is these same functions but take arguments normally.
202 .SH AUTHOR
203 .IX Header "AUTHOR"
204 Nick Ing\-Simmons \f(CW\*(C`ni\[email protected]\*(C'\fR
205 .PP
206 Maintained by Michael G Schwern \f(CW\*(C`[email protected]\*(C'\fR within the
207 ExtUtils\-MakeMaker package and, as a separate CPAN package, by
208 Randy Kobes \f(CW\*(C`[email protected]\*(C'\fR.