Home

 

Examples

 

Technical

 TextMaestro

 

2003 TextMaestro Technologies

 

  Examples

  Example 1

  Example 2

  Example 3

  Example 4

  Example 5

  Example 6

  Example 7

  Example 8

  Example 9

  Example 10

  Example 11

  Example 12

  Example 13

  Example 14

  Example 15

  Example 16

  Example 17

  Example 18

  Example 19

  Example 20

  Example 21

 

 

Example 7: Execute Remote Command using REXEC

 Caution: The remote host must have REXEC installed. Otherwise, this feature will not work.  

Let us first create a script file. There are several ways you can do that. Here is one.

Right click on any item in the list. The following pop-up menu will appear.

 

 

 

Select New file. A new window will appear, where suppose we enter my_script.txt and hit OK. Then the list will display the new item. One goodie is that this new file will have the same attributes of the selected file.

The new item is my_script.txt

 

Note, you could add an existing my_script.txt from local area.

 

 

 

As a good practice, click on File Attributes button, and you will see the attributes for my_script.txt.

 

(3) Click on pull-down menu FTP > FTP Advanced and the following toolbar will appear.

Click on Mark bat file button. This will change the icon of my_script.txt to indicate that it is a bat file.

 

 

(4) Now click on Run bat file button button. This will launch an REXEC session.

 

Caution: It is extremely important that the script file consists of valid commands. Otherwise, as the REXEC will execute the commands, it might very well foul up the remote host. Be careful when you mark a file as a bat file. Do not mark a spurious file as a bat file.

 

Suppose the contents of my_script.txt is the following:

Script file

# my_script.txt

echo '---------------- recurssive listing ---------------------'

ls -l -R

 

 

 

 

 

At this stage, TextMaestro will execute my_script.txt using REXEC and wait for the output. After the output is sent back to the client, it is displayed on the Input window. Here is the outcome from the execution:

Top