Configuring Multiline Script Options

You can use the OS Command component to configure multi-line scripts for interpreters such as the Bourne Shell or the C Shell.

You can add or modify the list of available interpreters using the OS Command Preferences.

  1. Double-click the OS Command component icon .

    The OS Command Component Editor appears.

  2. From the OS Command Component Editor, click the Basic tab.

  3. From the Type list, select Bourne Shell, C Shell, K Shell, Bash, or Windows Batch.

  4. In the Command Arguments text box, type any interpreter arguments.

    These arguments precede the script file in the argument list for the interpreter.

    Note: Any additional arguments to Windows cmd.exe must come before the required ‘/C’ option.

  5. In the Script Arguments text box, type any script arguments.

  6. In the Encoding (character set) list, select the encoding to use when the script is written to a disk file.

    Typically, encoding is used when running Isight in an Asian locale.

    Note: This list is visible only if Show File type encoding on the Files tab is selected on the Preferences dialog (Files and Directories). For more information about this option, refer Setting Files and Directories Preferences in the Isight User’s Guide.

  7. In the Line Ending list, select the line ending that you want to use when the script is written to a disk file.

    Note: This option is required if you are running an Isight model on Windows and using a grid plug-in to execute the program on Linux.

    Option Description
    Default Leave the line endings as they were found in the input file. Isight does not attempt to change the line endings. If the file has to be copied for some reason, local line endings are used.

    The Default option is recommended. The only time you would need to change the line endings is if you are running a Linux script from a Windows Gateway via the Grid option. In this case, you will have to force Linux line endings in the script because most Linux shells cannot handle Windows line endings.

    Local Write the file with the local line endings for the computer on which the model is running. This is the location of the Isight Gateway and the SIMULIA Execution Engine station. This means CR-LF on Windows and LF on Linux. The file will always be copied in text mode and the line endings updated, even if the line endings already appear to be correct.
    Linux Always separate lines with LF, even if the model is running on Windows.
    Windows Always separate lines with CR-LF, even if the model is running on Linux.

  8. In the Editor text box, edit the script.

    All the commands that you can type at the command line for the given interpreter are valid. The script you type is passed to the interpreter as-is, after expanding any parameter substitutions. You can remove all contents of the text box at any time by clicking Clear Script.

  9. In the Parameter list, select a parameter to use as an argument.

    • To add an existing parameter, click the Insert button.

      Isight adds the parameter name to the Arguments text box at the current cursor position and highlights it in green, indicating that the value will be substituted at run time.

    • To add a new parameter, type the parameter name in the Parameter box and click the button.

      The new parameter will be a string parameter, but you can change the type on the Design Gateway Parameters tab.

    • To delete a parameter from the arguments list, click the parameter and press the Backspace key.

    For more information about working with parameters, see About Entering Parameters.

    You can use any file substitution in the script. However, if you reference a shell script variable named "workid" as {workid}, an error can occur because "{workid}" would be substituted before the script is run.

  10. If desired, click Load Script to load a pre-existing script from a file.

  11. In the Affinities area, set the following options, as desired.

    The affinities for the selected interpreter are set to the values provided in the component preferences. Changing the affinities does not affect the preferences. For more information about the component properties, see Configuring the Affinities.

  12. Click OK to save your changes and to close the OS Command Component Editor.