You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

rexec.html 3.0 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
  5. <title>RExec Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="rexec">RExec</a></h2>
  9. <h3>Description</h3>
  10. Task to automate a remote rexec session. Just like the Telnet task,
  11. it uses nested <tt>&lt;read&gt;</tt> to indicate strings to wait for, and
  12. <tt>&lt;write&gt;</tt> tags to specify text to send to the remote process.
  13. <p><b>Note:</b> This task depends on external libraries not included in the Ant distribution.
  14. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <th>Attribute</th>
  19. <th>Values</th>
  20. <th>Required</th>
  21. </tr>
  22. <tr>
  23. <td>userid</td>
  24. <td>the login id to use on the remote server.</td>
  25. <td>Yes</td>
  26. </tr>
  27. <tr>
  28. <td>password</td>
  29. <td>the login password to use on the remote server.</td>
  30. <td>Yes</td>
  31. </tr>
  32. <tr>
  33. <td>server</td>
  34. <td>the address of the remote rexec server.</td>
  35. <td>Yes</td>
  36. </tr>
  37. <tr>
  38. <td>command</td>
  39. <td>the command to execute on the remote server.</td>
  40. <td>Yes</td>
  41. </tr>
  42. <tr>
  43. <td>port</td>
  44. <td>the port number of the remote rexec server. Defaults to port 512 in BSD Unix systems.</td>
  45. <td>No</td>
  46. </tr>
  47. <tr>
  48. <td>timeout</td>
  49. <td>set a default timeout to wait for a response. Specified in seconds. Default is no timeout.</td>
  50. <td>No</td>
  51. </tr>
  52. </table>
  53. <h3><a name="nested">Nested Elements</a></h3>
  54. The input to send to the server, and responses to wait for, are
  55. described as nested elements.
  56. <h4>read</h4>
  57. <p>declare (as a text child of this element) a string to wait for.
  58. The element supports the timeout attribute, which overrides any
  59. timeout specified for the task as a whole. It also has a <tt>string</tt>
  60. attribute, which is an alternative to specifying the string as
  61. a text element.
  62. </p>
  63. <i>It is not necessary to declare a closing <code>&lt;read&gt;</code> element like for the Telnet task. The connection is not broken until the command has completed and
  64. the input stream (output of the command) is terminated.
  65. </i>
  66. <h4>write</h4>
  67. <p>describes the text to send to the server. The <tt>echo</tt> boolean
  68. attribute controls whether the string is echoed to the local log;
  69. this is "true" by default
  70. </p>
  71. <h3>Example</h3>
  72. A simple example of connecting to a server and running a command.
  73. <blockquote><pre>
  74. &lt;rexec userid=&quot;bob&quot; password=&quot;badpass&quot; server=&quot;localhost&quot; command=&quot;ls&quot;/&gt;
  75. </pre></blockquote>
  76. The task can be used with other ports as well:
  77. <blockquote><pre>
  78. &lt;rexec port=&quot;80&quot; userid=&quot;bob&quot; password=&quot;badpass&quot; server=&quot;localhost&quot; command=&quot;ls&quot;/&gt;
  79. </pre></blockquote>
  80. <hr>
  81. <p align="center">Copyright &copy; 2003-2005 The Apache Software Foundation. All rights
  82. Reserved.</p>
  83. </body>
  84. </html>