SSH Client for Windows
Home Download Purchase Support Manual Screenshots Media About

4.3 Script Actions

All Private Shell script actions are described below in alphabetical order.

  • # Comment

    Designed to add comments to the script. When an action of this type is not selected in the list, the Action column is blank.

  • Change folder

    Changes current SFTP folder. Destination remote folder name is provided as a parameter. Does nothing when executed in a terminal window.

  • Change parameter

    Changes one parameter of the current Private Shell settings. Parameter name defines name of the parameter being changed (it can also be selected from the drop-down list) and Value sets the actual value. Accepted values entirely depend on a parameter selected.

  • Close window

    Closes current Private Shell window and disconnects from the server if necessary. This action doesn't accept parameters.

  • Conditional jump Expression to test is matched against Regular expression. Depending on the chosen condition (If matches... / If doesn't match), the script execution is transferred to a label specified in the Go to step labeled with drop-down box (which contains all labels of the script).

  • Connect

    Connects current Private Shell window to an SSH server with the current settings. Does nothing if a connection is already established. This action doesn't accept parameters.

  • Copy

    Copies the selected text or file into clipboard (does exactly the same action as the Edit->Copy menu item). This action doesn't accept parameters.

  • Delay

    Waits for the specified number of milliseconds (specified in the Delay for parameter).

  • Disconnect

    Disconnects current Private Shell window from the server. If there is no connection, does nothing. This action doesn't accept parameters.

  • End script

    Ends script execution. This action doesn't accept parameters.

  • File exists

    Tests if a specified file (the File name parameter) exists, and transfers execution control to another step specified in the Go to step labeled with field.

  • Goto

    Unconditionally transfers control to another script step. Accepts label name of the destination step as a parameter.

  • Load profile

    Loads settings from the Private Shell profile specified in the Load profile field. Clear the Load profile field to load the default profile.

  • Load settings

    Loads multiple Private Shell parameters into the current configuration. Parameters and their values can be entered directly in the Settings field in the following format:

    parameter_name=value

    or generated automatically if you click either the Edit or Edit and save only differences buttons. Each of these buttons displays standard Private Shell settings dialog based on the profile selected in the Base profile field, but when you click OK, the first button (Edit) outputs all available settings whereas the second one generates only those that were changed.

  • New window

    Opens a new Private Shell window (SSH or SFTP, in a separate window or inside a new tab). If the Switch to a new window option is set, the new window is sent to the foreground. The Connection setting determines how this new window is connected to a server (you can use an existing SSH connection, display a login dialog, or not to connect at all).

    As soon as the new window is opened, the execution of the script continues from the next step. In the parent window, script execution also continues, but jumps tp a specified label (see In this window continue with label parameter).

  • Paste

    Pastes data from the clipboard (does exactly the same action as the Edit->Paste menu item). Does nothing if no appropriate data is available on the clipboard. This action doesn't accept parameters.

  • Put

    Puts given text (the Put text parameter) into a terminal. Does nothing for SFTP window.

  • Read file

    Reads given file until a specified regular expression matches. The File name field defines a file to read from. The Find next match... field contains a regular expression.

    This action reads the source file (if the Start search from the begin of file box is checked, Private Shell reads file from the beginning, otherwise the last read position is used) until the given regular expression matches. Then it fills $0, $1, $2, etc. variables from the regular expression and saves read position internally, so you file parsing can be continued in the future. If the end of file is encountered before the regular expression matches, Private Shell transfers execution control to the specified label.

    The Common regular expressions button pops out a menu where commonly used regular expression are listed (such as "Read entire file", "Read one line" etc.).

  • Run program

    Runs a Windows application. The Program to run field defines an executable to run. All Windows executable files are supported (i.e. exe, bat, com). Additional command-line parameters are also supported (note: you may need to quote the executable file name to delimit it from the parameters).

    The executable name can also be selected from the standard Open a file dialog if you click the ... button at the right of the Program to run field.

    The Start-in folder specifies in which folder the application should start. If you need Private Shell to wait until the application quits, check the Wait for the program to terminate check box.

    Note: you cannot open a document with this action. If you need to open a document, you should find what program is associated with that document, launch it and pass the document name as a parameter (not supported by some software products).

  • Search

    Searches screen and scrollback buffers for specified text or regular expression match. The Search for the text field defines text to search for. If the Regular expression box is checked, search text is treated as a regular expression. The Start and End fields define search range in characters relative to the current cursor position. If the search text is not found (or regular expression does not match) in a given search range, Private Shell transfers execution control to the given label. Does nothing in SFTP window.

  • Set value

    Assigns given value (the New value field) to the given variable (the Variable field).

  • Wait for

    Waits till given text is received from the terminal. If the Regular expression box is checked, Private Shell treats the Wait for the text field as a regular expression and waits till it matches on text received from the terminal.

    The Timeout field defines timeout in milliseconds. If the wait operation does not complete within this period, it is considered as unsuccessful and Private Shell transfers execution control to the specified label. Does nothing in SFTP window.

  • Write file

    Writes given text into the specified file. If the Append to file option is checked and the specified file exists, the text is appended to it; otherwise the file is overwritten (or created if doesn't exist).


Comment On This Topic: