Creating a task

Top  Previous  Next

A task is a procedure to execute on the SSH server. A 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

 

// create a new task providing start prompt, command and end prompt as arguments

SshTask lsTask = new SshTask(shellPrompt,"ls -al",shellPrompt);





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC