ant/docs/manual/CoreTasks/echo.html
Stefan Bodewig b6a3e9df36 License police on documentation files:
(1) Make sure there is a Copyright notice on all visible files.

(2) Make sure all years in which the file has been modified are
listed.

(3) Make sure the format is consistent, i.e. separate consecutive
years with a dash, not a comma.

When Stephane changed starteam.html it has been 2001 in France but
2002 in Australia - does that mean we add 2002 to the Copyright line
or not?  ;-)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270652 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 08:48:33 +00:00

92 lines
2.7 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Apache Ant User Manual</title>
</head>
<body>
<h2><a name="echo">Echo</a></h2>
<h3>Description</h3>
<p>Echoes a message to the current loggers and listeners which
means <tt>System.out</tt> unless overridden. A <tt>level</tt>
can be specified, which controls at what logging level the message is
filtered at.
<p>
The task can also echo to a file, in which case the option to append rather
than overwrite the file is available, and the <tt>level</tt> option is
ignored</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">the message to echo.</td>
<td valign="top" align="center">Yes, unless data is included in a
character section within this element.</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file to write the message to.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">Append to an existing file?</td>
<td valign="top" align="center">No - default is false.</td>
</tr>
<tr>
<td valign="top">level</td>
<td valign="top">Control the level at which this message is reported.
One of "error", "warning", "info", "verbose", "debug"</td>
<td valign="top" align="center">No - default is "warning".</td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;echo message=&quot;Hello, world&quot;/&gt;</pre>
<pre>
&lt;echo&gt;This is a longer message stretching over
two lines.
&lt;/echo&gt;
</pre>
<pre>
&lt;echo&gt;
This is a longer message stretching over
three lines; the first line is a blank
&lt;/echo&gt;
</pre>
As XML parsers are wont to do, the first newline in the text element
has been included in the text.
<pre>&lt;echo message=&quot;Deleting drive C:&quot; level=&quot;debug&quot; /&gt;</pre>
A message which only appears in <tt>-debug</tt> mode.
<pre>&lt;echo level=&quot;error&quot; &gt;
Imminent failure in the antimatter containment facility.
Please withdraw to safe location at least 50km away.
&lt;/echo&gt;
</pre>
A message which appears even in <tt>-quiet</tt> mode.
<pre>&lt;echo file="runner.csh" append="false" &gt;#\!/bin/tcsh
java-1.3.1 -mx1024m ${project.entrypoint} $$*
</echo></pre>
Generate a shell script by echoing to a file.
Note the use of a double $ symbol to stop Ant
filtering out the single $ during variable expansion
<hr>
<p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
Reserved.</p>
</body>
</html>