tcl.tlib

Section: Misc. Reference Manual Pages (TCL)
Updated:
Index Return to Main Contents
 

NAME

Extended Tcl - Tcl procedure library  

INTRODUCTION

This manual page contains documentation for all of the procedures in the standard Tcl source library, tcl.tlib. Commands from the library, and any Tcl source library along your Tcl search path, TCLPATH, that contain properly formatted #@package definition comments, are automatically loaded the first time they are executed. See the Tcl Shell documentation for more details.

assign_fields list var [var...]

Assign successive elements in a list to specified variables. Any leftover fields are discarded. When there are more variable names than fields, the remaining variables are set to the empty string.

For example,

   assign_fields {dave 100 200 "Dave Foo"} name uid gid longName

Assigns name to ``dave'', uid to ``100'', gid to ``200'', and longName to ``Dave Foo''.

dirs
List the directories in the directory stack.
edprocs [proc...]

Writes the named procedures, or all currently defined procedures, to a temporary file, then calls an editor on it (as specified by the EDITOR environment variable, or vi if none is specified), then sources the file back in if it was changed.
for_array_keys var array_name code

Perform a foreach-style loop for each key in the named array. The break and continue statements work as with foreach.
for_file var filename { code }

For each line in filename, sets var to the line and executes code.

The break and continue commands work as with foreach.

For example, the command

        for_file line /etc/passwd {echo $line}

would echo all the lines in the password file.

for_recursive_glob var globlist code

Performs a foreach-style loop for each file and directory that recursively matched one or more patterns specified in the call to for_recursive_glob, setting var to the matching file or directory, and calling code. The break and continue statements work as expected.
intersect lista listb

Return the logical intersection of two lists.
intersect3 lista listb

Performs the intersecting of the two lists, returning a list containing three lists. The first list returned is everything in the first list that wasn't in the second. The second list contains the intersection of the two lists, and the third list contains all the elements that were in the second list but weren't in the first.
lrmdups list

Remove duplicate elements from a list. Sorts the specified list, removes any duplicate elements, and returns the result.
popd

Pop the top directory entry from the directory stack and make it the current directory.
pushd [dir]

Push the current directory onto the directory stack and cd to the specified directory. If the directory is not specified, then the current directory is pushed, but remains unchanged.
read_file fileName

Read the named file and returns the contents as a string.
recursive_glob globlist

Does the same thing as glob, except that it recursively descends all the matched subdirectories, returning a list of all the files that matched all pattern in the list globlist.
saveprocs fileName [proc...]

Save the definition of the named procedure, or all currently defined procedures if none is specified, to the named file.
showproc procname

List the definition of the named procedure, loading it if it is not already loaded.
showprocs [procname...]

List the definition of all of the named procedures, or all defined procedures if none are specified.
union lista listb
Return the logical union of the two specified lists. Any duplicate elements are removed.
write_file fileName stringVar

Writes the specified string to the named file.


 

Index

NAME
INTRODUCTION

This document was created by man2html, using the manual pages.
Time: 22:47:24 GMT, December 11, 2024