cli_script Script

Use cli_script to execute most of the CLI commands in batch mode when you provide a data file as input. The CLI sample data file, named datafile, contains switches that indicate the command to execute and also the necessary parameters to pass to the command. The script verifies that each command is executed successfully and also maintains a runtime log.
csp
Use cli_script to execute most of the CLI commands in batch mode when you provide a data file as input. The CLI sample data file, named datafile, contains switches that indicate the command to execute and also the necessary parameters to pass to the command. The script verifies that each command is executed successfully and also maintains a runtime log.
One advantage of this script is that you can create batch files using names instead of handles. For example, you can use a model type name, rather than the hexadecimal model type handle. While this makes the files easier to create and read, the real advantage comes when you want to perform subsequent actions on a model that you have created. Instead of assigning hexadecimal model handles to the model, you can refer to the model by name.
This script has the following format:
cli_script datafile
The cli_script uses two files, datafile and clean.awk, that are also located in the sample_scripts directory.
  • datafile
    Contains the input for cli_script. It contains each CLI command currently implemented in cli_script. See the cli_script header information for instructions about the format and syntax of this file.
  • clean.awk
    Contains the input used in execution. The .awk files are used for formatting what data appears to the console.
Consider the following points when working with cli_script:
  • Remember to change the “dummy” Network_Address (255.255.255.255) in the sample datafile to a real address.
  • If you move the cli_script to another directory, you must update the environment variable SPECROOT to the support root directory (SG-SUPPORT).
    For example, if the SG-SUPPORT files are in /usr/spectrum/SG-Support, set SPECROOT to /usr/spectrum.