Creating a task

Top  Previous  Next

A task is a procedure to execute on the SSH server. An SshTask instance represents a procedure to be executed on the SSH server.

 

Each SshTask contains a start prompt, command and end prompt. The start prompt is the data returned by the SSH server to indicate when the task may begin execution. The command is the command to execute on the SSH server. The end prompt is data returned by the SSH server used to indicate when the task has completed.

 

To create a task, create a new SshTask instance with a start prompt, command and end prompt as its arguments. The start prompt and end prompt usually represent the shell prompt that is displayed to the user when logging into a SSH server interactively.

 

For a SshTask to be considered for execution it must belong to a SshScript . This can be done using the SshScript.AddTask method. All SshTask are executed in the order they are added to the SshScript .

 

Example

 

[C#]

 

// create new task providing start prompt, command and end prompt

SshTask task1 = new SshTask("$","ls -al","$");

 

[VB]

 

' create new task providing start prompt, command and end prompt

Dim task1 As SshTask = New SshTask("$", "ls -al", "$")