lib2.tcl
Example:
proc test3 {} {
puts "In procedure test3"
}
Step 2
tclsh
Use this command to enter the Tcl shell.
Example:
workstation% tclsh
Step 3
auto_mkindex directory_name *.tcl
Use the auto_mkindex command to create the tclIndex file. The tclIndex file that contains a directory of all the procedures
contained in the Tcl library files. We recommend that you run auto_mkindex inside a directory because there can only
be a single tclIndex file in any directory and you may have other Tcl files to be grouped together. Running auto_mkindex
in a directory determines which tcl source file or files are indexed using a specific tclIndex.
Example:
workstation% auto_mkindex eem_library *.tcl
The following example TclIndex is created when the lib1.tcl and lib2.tcl files are in a library file directory and the
auto_mkindex command is run.
tclIndex
Example:
# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands. Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.
set auto_index(test1) [list source [file join $dir lib1.tcl]]
set auto_index(test2) [list source [file join $dir lib1.tcl]]
set auto_index(test3) [list source [file join $dir lib2.tcl]]
Step 4
Copy the Tcl library files from Creating an EEM User Tcl Library Index and the tclIndex file from Creating an EEM
User Tcl Library Index to the directory used for storing user library files on the target device.
Step 5
Copy a user-defined EEM policy file written in Tcl to the directory used for storing user-defined EEM policies on the
target device. The directory can be the same directory used in Creating an EEM User Tcl Library Index.
The directory for storing user-defined EEM policies can be the same directory used in Creating an EEM User Tcl Library
Index. The following example user-defined EEM policy can be used to test the Tcl library support in EEM.
libtest.tcl
Example:
::cisco::eem::event_register_none
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1797
How to Write Embedded Event Manager Policies Using Tcl