command.html
来自「perl教程」· HTML 代码 · 共 195 行
HTML
195 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc.</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc.</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#author">AUTHOR</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc.</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
perl -MExtUtils::Command -e cat files... > destination
perl -MExtUtils::Command -e mv source... destination
perl -MExtUtils::Command -e cp source... destination
perl -MExtUtils::Command -e touch files...
perl -MExtUtils::Command -e rm_f files...
perl -MExtUtils::Command -e rm_rf directories...
perl -MExtUtils::Command -e mkpath directories...
perl -MExtUtils::Command -e eqtime source destination
perl -MExtUtils::Command -e test_f file
perl -MExtUtils::Command -e chmod mode files...
...</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The module is used to replace common UNIX commands. In all cases the
functions work from @ARGV rather than taking arguments. This makes
them easier to deal with in Makefiles.</p>
<pre>
perl -MExtUtils::Command -e some_command some files to work on</pre>
<p><em>NOT</em></p>
<pre>
perl -MExtUtils::Command -e 'some_command qw(some files to work on)'</pre>
<p>For that use <a href="../../Shell/Command.html">the Shell::Command manpage</a>.</p>
<p>Filenames with * and ? will be glob expanded.</p>
<dl>
<dt><strong><a name="item_cat">cat</a></strong>
<dd>
<pre>
cat file ...</pre>
</dd>
<dd>
<p>Concatenates all files mentioned on command line to STDOUT.</p>
</dd>
<dt><strong><a name="item_eqtime">eqtime</a></strong>
<dd>
<pre>
eqtime source destination</pre>
</dd>
<dd>
<p>Sets modified time of destination to that of source.</p>
</dd>
<dt><strong><a name="item_rm_rf">rm_rf</a></strong>
<dd>
<pre>
rm_rf files or directories ...</pre>
</dd>
<dd>
<p>Removes files and directories - recursively (even if readonly)</p>
</dd>
<dt><strong><a name="item_rm_f">rm_f</a></strong>
<dd>
<pre>
rm_f file ...</pre>
</dd>
<dd>
<p>Removes files (even if readonly)</p>
</dd>
<dt><strong><a name="item_touch">touch</a></strong>
<dd>
<pre>
touch file ...</pre>
</dd>
<dd>
<p>Makes files exist, with current timestamp</p>
</dd>
<dt><strong><a name="item_mv">mv</a></strong>
<dd>
<pre>
mv source_file destination_file
mv source_file source_file destination_dir</pre>
</dd>
<dd>
<p>Moves source to destination. Multiple sources are allowed if
destination is an existing directory.</p>
</dd>
<dd>
<p>Returns true if all moves succeeded, false otherwise.</p>
</dd>
<dt><strong><a name="item_cp">cp</a></strong>
<dd>
<pre>
cp source_file destination_file
cp source_file source_file destination_dir</pre>
</dd>
<dd>
<p>Copies sources to the destination. Multiple sources are allowed if
destination is an existing directory.</p>
</dd>
<dd>
<p>Returns true if all copies succeeded, false otherwise.</p>
</dd>
<dt><strong><a name="item_chmod">chmod</a></strong>
<dd>
<pre>
chmod mode files ...</pre>
</dd>
<dd>
<p>Sets UNIX like permissions 'mode' on all the files. e.g. 0666</p>
</dd>
<dt><strong><a name="item_mkpath">mkpath</a></strong>
<dd>
<pre>
mkpath directory ...</pre>
</dd>
<dd>
<p>Creates directories, including any parent directories.</p>
</dd>
<dt><strong><a name="item_test_f">test_f</a></strong>
<dd>
<pre>
test_f file</pre>
</dd>
<dd>
<p>Tests if a file exists</p>
</dd>
<dt><strong><a name="item_dos2unix">dos2unix</a></strong>
<dd>
<pre>
dos2unix files or dirs ...</pre>
</dd>
<dd>
<p>Converts DOS and OS/2 linefeeds to Unix style recursively.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>Shell::Command which is these same functions but take arguments normally.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Nick Ing-Simmons <code>ni-s@cpan.org</code></p>
<p>Currently maintained by Michael G Schwern <code>schwern@pobox.com</code>.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?