script (scr)

Description

Run a script of commands.

The script may contain any valid AppScan® Source command line interface (CLI) commands with arguments. The record (rc) command can generate the script file.

Scripts can reference environmental variables, using the ${VAR} notation (where VAR is the name of an environmental variable).

When the script command is passed to AppScanSrcCli from the command line, it automatically exits AppScanSrcCli at the end of the script.

Syntax

script script_file

script_file: Full path and file name of the script file that you want to run.

Comments in Scripts

A line preceded by a number sign (#) is a comment. The CLI skips comments when run interactively, or from within a script file.

The following example script contains comments:

login localhost User 123456
#navigate to my workspace
cd MyApplication
#scan my application
scan
logout

Examples

A user who typically logs in and uses the CLI interactively may want to record a script to execute repeatedly while running from the console. You can script an entire session using the record (rc) command, and run it repeatedly or at scheduled intervals. Use a script to automate an entire session by allowing a single batch file or script to log in, create projects, scan, copy files, and so forth.

  • To run a script, named myscript.txt:
    AllApplications>> Script c:\myscript.txt
  • The following example script logs in, turns on logging, creates an application, imports all ppf projects under a given directory, runs an assessment, and exits:
    log on C:\mylogfile.log
    new MyApplication C:\myAppFolder
    cd MyApplication
    im c:\Projects\*.ppf
    scan
    logout

    Note that logout is not necessary if the script always runs from the AppScanSrcCli command line.