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 2.9 KiB

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