1ExtUtils::Command(3) User Contributed Perl Documentation ExtUtils::Command(3)
2
3
4
6 ExtUtils::Command - utilities to replace common UNIX commands in
7 Makefiles etc.
8
10 perl -MExtUtils::Command -e cat files... > destination
11 perl -MExtUtils::Command -e mv source... destination
12 perl -MExtUtils::Command -e cp source... destination
13 perl -MExtUtils::Command -e touch files...
14 perl -MExtUtils::Command -e rm_f files...
15 perl -MExtUtils::Command -e rm_rf directories...
16 perl -MExtUtils::Command -e mkpath directories...
17 perl -MExtUtils::Command -e eqtime source destination
18 perl -MExtUtils::Command -e test_f file
19 perl -MExtUtils::Command -e test_d directory
20 perl -MExtUtils::Command -e chmod mode files...
21 ...
22
24 The module is used to replace common UNIX commands. In all cases the
25 functions work from @ARGV rather than taking arguments. This makes
26 them easier to deal with in Makefiles. Call them like this:
27
28 perl -MExtUtils::Command -e some_command some files to work on
29
30 and NOT like this:
31
32 perl -MExtUtils::Command -e 'some_command qw(some files to work on)'
33
34 For that use Shell::Command.
35
36 Filenames with * and ? will be glob expanded.
37
38 FUNCTIONS
39 cat
40 cat file ...
41
42 Concatenates all files mentioned on command line to STDOUT.
43
44 eqtime
45 eqtime source destination
46
47 Sets modified time of destination to that of source.
48
49 rm_rf
50 rm_rf files or directories ...
51
52 Removes files and directories - recursively (even if readonly)
53
54 rm_f
55 rm_f file ...
56
57 Removes files (even if readonly)
58
59 touch
60 touch file ...
61
62 Makes files exist, with current timestamp
63
64 mv
65 mv source_file destination_file
66 mv source_file source_file destination_dir
67
68 Moves source to destination. Multiple sources are allowed if
69 destination is an existing directory.
70
71 Returns true if all moves succeeded, false otherwise.
72
73 cp
74 cp source_file destination_file
75 cp source_file source_file destination_dir
76
77 Copies sources to the destination. Multiple sources are allowed if
78 destination is an existing directory.
79
80 Returns true if all copies succeeded, false otherwise.
81
82 chmod
83 chmod mode files ...
84
85 Sets UNIX like permissions 'mode' on all the files. e.g. 0666
86
87 mkpath
88 mkpath directory ...
89
90 Creates directories, including any parent directories.
91
92 test_f
93 test_f file
94
95 Tests if a file exists. Exits with 0 if it does, 1 if it does not
96 (ie. shell's idea of true and false).
97
98 test_d
99 test_d directory
100
101 Tests if a directory exists. Exits with 0 if it does, 1 if it does
102 not (ie. shell's idea of true and false).
103
104 dos2unix
105 dos2unix files or dirs ...
106
107 Converts DOS and OS/2 linefeeds to Unix style recursively.
108
110 Shell::Command which is these same functions but take arguments
111 normally.
112
114 Nick Ing-Simmons "ni-s@cpan.org"
115
116 Maintained by Michael G Schwern "schwern@pobox.com" within the
117 ExtUtils-MakeMaker package and, as a separate CPAN package, by Randy
118 Kobes "r.kobes@uwinnipeg.ca".
119
120
121
122perl v5.38.0 2023-07-20 ExtUtils::Command(3)