| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (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 |
.\" |
| 57 |
.IX Title "ExtUtils::Command 3perl" |
| 58 |
.TH ExtUtils::Command 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
ExtUtils::Command \- utilities to replace common UNIX commands in Makefiles etc. |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 12 |
| 68 |
\& perl \-MExtUtils::Command \-e cat files... > destination |
| 69 |
\& perl \-MExtUtils::Command \-e mv source... destination |
| 70 |
\& perl \-MExtUtils::Command \-e cp source... destination |
| 71 |
\& perl \-MExtUtils::Command \-e touch files... |
| 72 |
\& perl \-MExtUtils::Command \-e rm_f files... |
| 73 |
\& perl \-MExtUtils::Command \-e rm_rf directories... |
| 74 |
\& perl \-MExtUtils::Command \-e mkpath directories... |
| 75 |
\& perl \-MExtUtils::Command \-e eqtime source destination |
| 76 |
\& perl \-MExtUtils::Command \-e test_f file |
| 77 |
\& perl \-MExtUtils::Command \-e test_d directory |
| 78 |
\& perl \-MExtUtils::Command \-e chmod mode files... |
| 79 |
\& ... |
| 80 |
.Ve |
| 81 |
.SH DESCRIPTION |
| 82 |
.IX Header "DESCRIPTION" |
| 83 |
The module is used to replace common UNIX commands. In all cases the |
| 84 |
functions work from \f(CW@ARGV\fR rather than taking arguments. This makes |
| 85 |
them easier to deal with in Makefiles. Call them like this: |
| 86 |
.PP |
| 87 |
.Vb 1 |
| 88 |
\& perl \-MExtUtils::Command \-e some_command some files to work on |
| 89 |
.Ve |
| 90 |
.PP |
| 91 |
and \fINOT\fR like this: |
| 92 |
.PP |
| 93 |
.Vb 1 |
| 94 |
\& perl \-MExtUtils::Command \-e \*(Aqsome_command qw(some files to work on)\*(Aq |
| 95 |
.Ve |
| 96 |
.PP |
| 97 |
For that use Shell::Command. |
| 98 |
.PP |
| 99 |
Filenames with * and ? will be glob expanded. |
| 100 |
.SS FUNCTIONS |
| 101 |
.IX Subsection "FUNCTIONS" |
| 102 |
.IP cat 4 |
| 103 |
.IX Item "cat" |
| 104 |
.Vb 1 |
| 105 |
\& cat file ... |
| 106 |
.Ve |
| 107 |
.Sp |
| 108 |
Concatenates all files mentioned on command line to STDOUT. |
| 109 |
.IP eqtime 4 |
| 110 |
.IX Item "eqtime" |
| 111 |
.Vb 1 |
| 112 |
\& eqtime source destination |
| 113 |
.Ve |
| 114 |
.Sp |
| 115 |
Sets modified time of destination to that of source. |
| 116 |
.IP rm_rf 4 |
| 117 |
.IX Item "rm_rf" |
| 118 |
.Vb 1 |
| 119 |
\& rm_rf files or directories ... |
| 120 |
.Ve |
| 121 |
.Sp |
| 122 |
Removes files and directories \- recursively (even if readonly) |
| 123 |
.IP rm_f 4 |
| 124 |
.IX Item "rm_f" |
| 125 |
.Vb 1 |
| 126 |
\& rm_f file ... |
| 127 |
.Ve |
| 128 |
.Sp |
| 129 |
Removes files (even if readonly) |
| 130 |
.IP touch 4 |
| 131 |
.IX Item "touch" |
| 132 |
.Vb 1 |
| 133 |
\& touch file ... |
| 134 |
.Ve |
| 135 |
.Sp |
| 136 |
Makes files exist, with current timestamp |
| 137 |
.IP mv 4 |
| 138 |
.IX Item "mv" |
| 139 |
.Vb 2 |
| 140 |
\& mv source_file destination_file |
| 141 |
\& mv source_file source_file destination_dir |
| 142 |
.Ve |
| 143 |
.Sp |
| 144 |
Moves source to destination. Multiple sources are allowed if |
| 145 |
destination is an existing directory. |
| 146 |
.Sp |
| 147 |
Returns true if all moves succeeded, false otherwise. |
| 148 |
.IP cp 4 |
| 149 |
.IX Item "cp" |
| 150 |
.Vb 2 |
| 151 |
\& cp source_file destination_file |
| 152 |
\& cp source_file source_file destination_dir |
| 153 |
.Ve |
| 154 |
.Sp |
| 155 |
Copies sources to the destination. Multiple sources are allowed if |
| 156 |
destination is an existing directory. |
| 157 |
.Sp |
| 158 |
Returns true if all copies succeeded, false otherwise. |
| 159 |
.IP chmod 4 |
| 160 |
.IX Item "chmod" |
| 161 |
.Vb 1 |
| 162 |
\& chmod mode files ... |
| 163 |
.Ve |
| 164 |
.Sp |
| 165 |
Sets UNIX like permissions 'mode' on all the files. e.g. 0666 |
| 166 |
.IP mkpath 4 |
| 167 |
.IX Item "mkpath" |
| 168 |
.Vb 1 |
| 169 |
\& mkpath directory ... |
| 170 |
.Ve |
| 171 |
.Sp |
| 172 |
Creates directories, including any parent directories. |
| 173 |
.IP test_f 4 |
| 174 |
.IX Item "test_f" |
| 175 |
.Vb 1 |
| 176 |
\& test_f file |
| 177 |
.Ve |
| 178 |
.Sp |
| 179 |
Tests if a file exists. \fIExits\fR with 0 if it does, 1 if it does not (ie. |
| 180 |
shell's idea of true and false). |
| 181 |
.IP test_d 4 |
| 182 |
.IX Item "test_d" |
| 183 |
.Vb 1 |
| 184 |
\& test_d directory |
| 185 |
.Ve |
| 186 |
.Sp |
| 187 |
Tests if a directory exists. \fIExits\fR with 0 if it does, 1 if it does |
| 188 |
not (ie. shell's idea of true and false). |
| 189 |
.IP dos2unix 4 |
| 190 |
.IX Item "dos2unix" |
| 191 |
.Vb 1 |
| 192 |
\& dos2unix files or dirs ... |
| 193 |
.Ve |
| 194 |
.Sp |
| 195 |
Converts DOS and OS/2 linefeeds to Unix style recursively. |
| 196 |
.SH "SEE ALSO" |
| 197 |
.IX Header "SEE ALSO" |
| 198 |
Shell::Command which is these same functions but take arguments normally. |
| 199 |
.SH AUTHOR |
| 200 |
.IX Header "AUTHOR" |
| 201 |
Nick Ing-Simmons \f(CW\*(C`ni\[email protected]\*(C'\fR |
| 202 |
.PP |
| 203 |
Maintained by Michael G Schwern \f(CW\*(C`[email protected]\*(C'\fR within the |
| 204 |
ExtUtils-MakeMaker package and, as a separate CPAN package, by |
| 205 |
Randy Kobes \f(CW\*(C`[email protected]\*(C'\fR. |