InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.0: About user assistance >
6.6.0.2: Command line administration >
6.6.0.2.2: WebSphere Control Program (wscp) >
6.6.0.2.2.3: Advanced usage of wscp >
6.6.0.2.2.3.14: Where to find more information about Tcl

6.6.0.2.2.3.14: Where to find more information about Tcl

The following are some useful Tcl commands for writing wscp scripts. For additional information on Tcl, refer to Tcl and the TK Toolkit by John K. Ousterhout (Addison Wesley), or to the Tcl developer Web site at http://www.scriptics.com.

  • set. Creates, reads, and modifies variables.
    set serv "/Node:dev-pc/ApplicationServer:myAppServer/"
    

  • eval. Accepts any number of arguments, concatenates them with separator spaces, then executes the result as a Tcl script. One use of eval is for generating commands, saving them in variables, and then later evaluating the variables as Tcl scripts.
    set cmd {ApplicationServer stop /Node:MyNode/ApplicationServer:MyServer/}
    . . .
    eval $cmd
    

  • exec. Creates one or more new processes and waits until they are complete before returning. Looks for an executable file in the working directory or uses the PATH environment variable.
    exec date
    

  • global. Makes global variables available inside a procedure.
    global errorCode
    

  • lappend. Appends new elements to a list stored in a variable.
    set vars {value1 value2 value3}
    value1 value2 value3
    lappend vars value4
    value1 value2 value3 value4
    

  • lindex. Extracts an element from a list.
    lindex $vars  2
    value3
    

  • lreplace. Deletes elements from a list and optionally adds new elements. The first argument is a list, and the second and third arguments are the indices of the first and last elements to be deleted.
    lreplace $vars 1 2
    value1 value4
    

  • lsearch. Searches a list for an element with a particular pattern and returns the index of the first matching element that is found.
    lsearch $vars value4
    3
    

  • proc. Creates a named procedure and assigns a list of arguments to be used with that procedure.
    proc checkStatus {expectedStatus}
    proc getAttrs {name array args}
    
Go to previous article: 6.6.0.2.2.3.13: Connecting to remote servers Go to next article: 6.6.0.2.2.4: Example wscp commands, procedures, and scripts

 

 
Go to previous article: 6.6.0.2.2.3.13: Connecting to remote servers Go to next article: 6.6.0.2.2.4: Example wscp commands, procedures, and scripts