home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-19 | 45.3 KB | 1,247 lines |
- Newsgroups: comp.sources.misc
- From: karl@sugar.neosoft.com (Karl Lehenbauer)
- Subject: v26i023: tclx - extensions and on-line help for tcl 6.1, Part23/23
- Message-ID: <1991Nov19.135902.1758@sparky.imd.sterling.com>
- X-Md4-Signature: 6cd0ad6dc5dc7c33ca265032d75c97e3
- Date: Tue, 19 Nov 1991 13:59:02 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: karl@sugar.neosoft.com (Karl Lehenbauer)
- Posting-number: Volume 26, Issue 23
- Archive-name: tclx/part23
- Environment: UNIX
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 23 (of 23)."
- # Contents: extended/man/TclX.man
- # Wrapped by karl@one on Wed Nov 13 21:50:34 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'extended/man/TclX.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'extended/man/TclX.man'\"
- else
- echo shar: Extracting \"'extended/man/TclX.man'\" \(42986 characters\)
- sed "s/^X//" >'extended/man/TclX.man' <<'END_OF_FILE'
- X.TH "TclX" TCL "" "Tcl"
- X.ad b
- X'@index: tclx ExtendedTcl
- X.SH NAME
- XTclX - Extended Tcl - Extended command set for Tcl 6.1.
- X'
- X.SH "INTRODUCTION"
- X.PP
- XThis man page contains the documentation for all of the extensions that are
- Xadded to Tcl 6.1 by Extended Tcl. These extensions provide their
- Xcapabilities by adding new commands to Tcl whitout changing the syntax of
- Xstandard Tcl. Extended Tcl is a superset of standard Tcl and is built with
- Xthe standard Tcl sources.
- X.TP
- XThe command descriptions are separated into several sections:
- X.TP
- Xo General Commands
- X.TP
- Xo Unix Access Commands
- X.TP
- Xo File I/O Commands
- X.TP
- Xo File Scanning Commands
- X.TP
- Xo Math Commands
- X.TP
- Xo List Manipulation Commands
- X.TP
- Xo Keyed Lists
- X.TP
- Xo String and Character Manipulation Commands
- X'
- X.SH "GENERAL COMMANDS"
- X.PP
- XA set of general useful Tcl commands. Includes interactive inputting of
- Xcommands, a facility for tracing execution and a looping command.
- X'
- X'@help: extended/commandloop
- X'@brief: Create an interactive command loop.
- X.TP
- X.B commandloop [\fIprompt\fR] [\fIprompt2\fR]
- X.br
- XCreate an interactive command loop for the current TCL interpreter. This
- Xcommand receives commands from stdin and executes them. This command is
- Xuseful for non-interactive TCL scripts that want to enter an interactive mode.
- X\fIPrompt\fR is a command string to set the top level prompt hook to
- X to, the contents of which is executed to generate the main prompt.
- X\fIPrompt2\fR is a command string to set the down level prompt to, which is
- Xgenerates the prompt command for continuation input. When the command
- Xterminates, the variables for the prompt hooks will be set to their old value.
- XIf these arguments are not specified, the prompt hooks use their current
- Xvalue. Prompt hooks are TCL code that return as their result the prompt to
- Xoutput. The result of the last command executed in the command string (which
- Xmay be a \fBreturn\fR) will be outputted as the prompt.
- X'@endhelp
- X'@help: extended/cmdtrace
- X'@brief: Trace Tcl execution.
- X.TP
- X.B cmdtrace \fIlevel\fR|\fBon\fR [\fBnoeval\fR] [\fBnotruncate\fR] [\fBflush\fR] [\fIfilehandle\fR]
- X.br
- XPrint a trace statement for all commands executed at depth of \fIlevel\fR or
- Xbelow (1 is the top level). If \fBon\fR is specified, all commands at any
- Xlevel are traced.
- XIf \fBnoeval\fR is specified, arguments are
- Xprinted unevaluated -- if it is not specified, the arguments are printed after
- Xevaluation. If the command line is longer than 60 characters, it is truncated
- Xto 60 and a "..." is postpended to indicate that there was more. If
- X\fBnoeval\fR wasn't specified, the arguments are printed after evaluation. In
- Xthis case, each argument is truncated to 40 characters (with "..." postpended
- Xif the argument was longer than 40 characters) and printed. If an evaluated
- Xargument contains a space, the entire argument will be enclosed inside of
- Xbraces (`{}') to allow the reader to visually separate the arguments from
- Xeach other. If \fBnotruncate\fR is specified, then the truncation of commands
- Xand evaluated arguments will be disabled. If \fBflush\fR is specified, then
- Xthe output buffer will be flushed after each line is printed. This is useful
- Xwhen tracing code that cause an application to abort, making it easy to narrow
- Xthe problem down to the command that caused the abort. If \fIfilehandle\fR is
- Xspecified, then the trace output will be written to the file.
- X.TP
- X.B cmdtrace off
- XTurn off all tracing.
- X.TP
- X.B cmdtrace depth
- X.br
- XReturns the current maximum trace level, or zero if trace is disabled.
- X'@endhelp
- X'@help: extended/echo
- X'@brief: Echo one or more strings to stdout, followed by a newline.
- X.TP
- X.B echo \fIstr1\fR [\fIstr2..\fR]
- X.br
- XPrint the strings to stdout followed by a newline.
- X'@endhelp
- X'@help: extended/infox
- X'@brief: Return information about extended Tcl or the current application.
- X.TP
- X.B infox \fIoption\fR
- X.br
- XReturn information about extended Tcl or the current application.
- XThe following \fBinfox\fR command options are available.
- X.RS 5
- X.TP
- X.B version
- XReturn the version number of Extended Tcl. The version number for
- Xextended Tcl is generated by combining the base version of the standard Tcl
- Xcode with a letter indicating the version of Extended Tcl being used. This is
- Xthe documentation for version \fBtcl6.1a\fR.
- X.TP
- X.B patchlevel
- XReturn the patchlevel for Extended Tcl.
- X.TP
- X.B appname
- XReturn the symbolic application name of the current application linked with
- Xthe Extended Tcl library. The C variable \fBtclAppName\fR must be set by the
- Xapplication to return an application specific value for this variable.
- X.TP
- X.B applongname
- XReturn a natural language name for the current application. The C variable
- X\fBtclLongAppName\fR must be set by the application to return an application
- Xspecific value for this variable.
- X.TP
- X.B appversion
- XReturn the version number for the current application. The C variable
- X\fBtclAppVersion\fR must be set by the application to return an application
- Xspecific value for this variable.
- X.RE
- X'@endhelp
- X'@help: extended/loop
- X'@brief: Higher-performance for-style loop.
- X.TP
- X.B loop \fIvar first last [increment] body\fR
- X.br
- X\fBLoop\fR is a looping command, similar in behavior to the Tcl \fBfor\fR
- Xstatement, except that the \fBloop\fR statement achieves substantially higher
- Xperformance and is easier to code when the beginning and ending values of a
- Xloop are known and the loop variable is to be incremented by a known, fixed
- Xamount every time through.
- X.sp
- X The \fIvar\fR argument is the name of a Tcl variable that will contain the
- Xloop index. The loop index is first set to the value specified by
- X\fIfirst\fR. The Tcl interpreter is invoked upon \fIbody\fR zero or more
- Xtimes, where \fIvar\fR is incremented by \fIincrement\fR every time through
- Xthe loop, or by one if \fIincrement\fR is not specified. \fIIncrement\fR can
- Xbe negative in which case the loop will count downwards.
- X.sp
- XWhen \fIvar\fR reaches \fIlast\fR, the loop terminates without a subsequent
- Xexecution of \fIbody\fR. For instance, if the original \fBloop\fR parameters
- Xwould cause \fBloop\fR to terminate, say \fIfirst\fR was one, \fIlast\fR was
- Xzero and \fIincrement\fR was not specified or was non-negative, \fIbody\fR is
- Xnot executed at all and \fBloop\fR returns.
- X.sp
- XIf a \fBcontinue\fR command is invoked within \fIbody\fR then
- Xany remaining commands in the current execution of \fIbody\fR are skipped,
- Xas in the \fBfor\fR command.
- XIf a \fBbreak\fR command is invoked
- Xwithin \fIbody\fR
- Xthen the \fBloop\fR command will
- Xreturn immediately.
- X\fBLoop\fR returns an empty string.
- X'@endhelp
- X'
- X.SH "UNIX ACCESS COMMANDS
- X.PP
- XThese commands provide access to many basic Unix facilities, including process
- Xhandling, data and time, signal handling, linking and unlinking files,
- Xchanging file attributes, process and user attributes and the executing
- Xcommands via the shell.
- X'
- X'@help: extended/alarm
- X'@brief: Set a process alarm clock.
- X.TP
- X.B alarm \fIseconds\fR
- X.br
- XInstructs the system to send a SIGALRM signal in the specified number of
- Xseconds. If \fIseconds\fR is 0, any previous alarm request is canceled.
- XOnly one alarm at a time may be active, the command returns the number of
- Xseconds left in the previous alarm.
- X'@endhelp
- X'
- X'@help: extended/chgrp
- X'@brief: Change file group.
- X.TP
- X.B chgrp \fIgroup\fR \fIfilelist\fR
- X.br
- XSet group of each file in the list \fIfilelist\fR to \fIgroup\fR, which is a
- Xgroup name or numeric group id.
- X'@endhelp
- X'@help: extended/chmod
- X'@brief: Set file permissions.
- X.TP
- X.B chmod [\fB-i\fR] \fImode\fR \fIfilelist\fR
- X.br
- XSet permissions of each of the files in the list \fIfilelist\fR to \fImode\fR,
- Xwhich is an absolute numeric mode or symbolic permissions as in the
- X\fBchmod(C)\fR UNIX command. Normally absolute modes are assumed to be
- Xspecified in octal. However Tcl stores numbers internally as integers. The
- X\fB-i\fR option causes an absolute mode to be treated as a standard Tcl
- Xinteger (decimal unless prefixed by "0" of "0x").
- X'@endhelp
- X'@help: extended/chown
- X'@brief: Change file owner and/or group.
- X.TP
- X.B chown \fIowner\fR|{\fIowner group\fR} \fIfilelist\fR
- X.br
- XSet owner of each file in the list \fIfilelist\fR to \fIowner\fR, which is a
- Xowner name or numeric owner id. If the first parameter is a list, then the
- Xowner is set to the first element of the list and the group is set to the
- Xsecond element of the list. \fIGroup\fR is a group name or numeric group id.
- XIf \fIgroup\fR is {}, then the file group will be set to the group for the
- Xassociated the specified user.
- X'@endhelp
- X'@help: extended/execvp
- X'@brief: Perform a process exec, executing a file.
- X.TP
- X.B execvp \fIprog\fR [\fIarg1...argN\fR]
- X.br
- XDo an execvp, replacing the current program with \fIprog\fR and passing the
- Xarguments \fIarg1...argN\fR.
- X'@endhelp
- X'@help: extended/fmtclock
- X'@brief: Convert integer time to human-readable format.
- X.TP
- X.B fmtclock \fIclockval\fR [\fIformat\fR] [\fBGMT|{}\fR]
- X.br
- XConvert a value returned by \fBgetclock\fR or \fBfile\fR to human readable
- Xform. The \fIformat\fR argument is a string that describes how to format the
- Xdate and time. Field descriptors consist of a ``%'' followed by a field
- Xdescriptor. All other characters are copied into the result. The available
- Xfield descriptors are:
- X.sp
- X.nf
- X.ft CW
- X %% - Insert a %.
- X %a - Abbreviated weekday name.
- X %A - Full weekday name
- X %b - Abbreviated month name.
- X %B - Full month name.
- X %d - Day of month (01 - 31).
- X %D - Date as %m/%d/%y.
- X %e - Day of month (1-31), no leading zeros.
- X %h - Abbreviated month name.
- X %H - Hour (00 - 23).
- X %I - Hour (00 - 12).
- X %j - Day number of year (001 - 366).
- X %m - Month number (01 - 12).
- X %M - Minute (00 - 59).
- X %n - Insert a new line.
- X %p - AM or PM.
- X %r - Time as %I:%M:%S %p.
- X %R - Time as %H:%M.
- X %S - Seconds (00 - 59).
- X %t - Insert a tab.
- X %T - Time as %H:%M:%S.
- X %U - Week number of year (01 - 52), Sunday is the first
- X day of the week.
- X %w - Weekday number (Sunday = 0).
- X %W - Week number of year (01 - 52), Monday is the first
- X day of the week.
- X %x - Local specific date format.
- X %X - Local specific time format.
- X %y - Year within century (00 - 99).
- X %Y - Year as ccyy (e.g. 1990)
- X %Z - Time zone name.
- X.fi
- X.ft R
- X.sp
- XIf format is not specified, "%a %b %d %H:%M:%S %Z %Y" is used. If \fBGMT\fR
- Xis specified, the time will be formated as Greenwich Mean Time. If the
- Xargument is not specified or is empty, then the local timezone will be used as
- Xdefined by the timezone environment variable.
- X'@endhelp
- X'@help: extended/fork
- X'@brief: Fork the current Tcl process.
- X.TP
- X.B fork
- X.br
- XFork the current TCL process. Fork returns zero to the child process and the
- Xprocess number of the child to the parent process. If an \fBexecvp\fR is not
- Xgoing to be performed before the forked process does output, then a
- X\fBflush\fR should be issued against \fBstdout\fR, \fBstderr\fR and any other
- Xopen output file before doing the \fBfork\fR. Otherwise, output from the
- Xparent process pending in the buffers will also be outputted by the child
- Xprocess.
- X'@endhelp
- X'@help: extended/getclock
- X'@brief: Return current date and time as an integer value.
- X.TP
- X.B getclock
- X.br
- XReturn the current date and time as a system dependent integer value. The
- Xunit of the value is seconds, allowing it to be used for relative time
- Xcalculations and so forth.
- X'@endhelp
- X'@help: extended/id
- X'@brief: Access, set or convert process, user and group information.
- X.TP
- X.B id options
- X.br
- XThis command provides a means of getting, setting and converting user, group
- Xand process ids. The following versions of the \fBid\fR command are available:
- X'
- X.RS 5
- X.TP
- X.B id user \fR[\fIname\fR]
- X.TP
- X.B id userid \fR[\fIuid\fR]
- XSet the real and effective user ID to \fIname\fR or \fIuid\fR, if the
- Xname (or uid) is valid and permissions allow it. If the name (or uid)
- Xis not specified, the current name (or uid) is returned.
- X.TP
- X.B id convert userid \fIuid\fR
- X.TP
- X.B id convert user \fIname\fR
- XConvert a user ID number to a user name, or vice versa.
- X.TP
- X.B id group \fR[\fIname\fR]
- X.TP
- X.B id groupid \fR[\fIgid\fR]
- XSet the real and effective group ID to \fIname\fR or \fIgid\fR, if the
- Xname (or gid) is valid and permissions allow it. If the group name
- X(or gid) is not specified, the current group name (or gid) is returned.
- X.TP
- X.B id convert groupid \fIgid\fR
- X.TP
- X.B id convert group \fIname\fR
- XConvert a group ID number to a group name, or vice versa.
- X.TP
- X.B id effective user
- X.TP
- X.B id effective userid
- XReturn the effective user name, or effective user ID number, respectively.
- X.TP
- X.B id effective group
- X.TP
- X.B id effective groupid
- XReturn the effective group name, or effective group ID number, respectively.
- X.TP
- X.B id process
- X.br
- XReturn the process ID of the current process.
- X.TP
- X.B id process parent
- X.br
- XReturn the process ID of the parent of the current process.
- X.TP
- X.B id process group
- X.br
- XReturn the process group ID of the current process.
- X.TP
- X.B id process group set
- X.br
- XSet the process group ID of the current process to its process ID.
- X.RE
- X'@endhelp
- X'
- X'@help: extended/kill
- X'@brief: Send a signal to the specified process.
- X.TP
- X.B kill [\fIsignal\fR] \fIprocesslist\fR
- X.br
- XSend a signal to the each process in the list \fIprocesslist\fR, if permitted.
- X\fISignal\fR, if present, is the signal number or the symbolic name of the
- Xsignal, see the signal system call manual page. The leading "SIG" is optional
- Xwhen the signal is specified by its symbolic name.
- X.PP
- XThe default for \fIsigno\fR is 15, SIGTERM.
- X'@endhelp
- X'@help: extended/link
- X'@brief: Make a link to a file.
- X.TP
- X.B link \fIsrcpath destpath\fR
- X.br
- XCreate a directory entry, \fIdestpath\fR, linking it to the existing file,
- X\fIsrcpath\fR.
- X'@endhelp
- X'@help: extended/mkdir
- X'@brief: Create a new directory
- X.TP
- X.B mkdir [-path] \fIdirList\fR
- X.br
- XCreate each of the directories in the list \fIdirList\fR. The mode on the
- Xnew directories is 777, modified by the umask. If \fB-path\fR is specified,
- Xthen any non-existent parent directories in the specified path are also
- Xcreated.
- X'@endhelp
- X'@help: extended/rmdir
- X'@brief: Remove directories
- X.TP
- X.B rmdir \fIdirList\fR
- X.br
- XRemove each of the directories in the list \fIdirList\fR.
- X'@endhelp
- X'@help: extended/signal
- X'@brief: Specify action to take when a signal is received.
- X.TP
- X.B signal \fIaction\fR \fIsiglist\fR [\fIcommand\fR]
- X.br
- XSpecify the action to take when a Unix signal occurs. \fISiglist\fR is a list
- Xof either the symbolic or numeric Unix signal (the SIG prefix is optional).
- X\fIAction\fR is one of the following actions to be performed on receipt of the
- Xsignal.
- X.IP
- X\fBdefault\fR - Terminate the process
- X.IP
- X\fBignore\fR - Ignore the signal.
- X.IP
- X\fBerror\fR - Generate a catchable Tcl error. It will be as if the command
- Xthat was running returned an error. The error code will be in the form:
- X.br
- X {\fBUNIX SIG\fR \fIsigname\fR}
- X.br
- XFor the death of child signal, \fIsigname\fR will always be SIGCHLD, rather
- Xthan SIGCLD, to allow writting protable code.
- X.IP
- X\fBtrap\fR - When the signal occures, execute \fIcommand\fR and continue
- Xexecution if an error is not returned by \fIcommand\fR. If will be executed
- Xin the global context and the symbolic signal name (e.g. SIGINT) will be
- Xsupplied in a global variable \fBsignalRecieved\fR. If an error is returned,
- Xthen follow the standard Tcl error mechanism. Often \fIcommand\fR will just
- Xdo an \fBexit\fR.
- X.IP
- X\fBget\fR - Retrieve the current settings of the specified signals. A list
- Xwill be returned with each element containing one of `\fBdefault\fR',
- X`\fBignore\fR', `\fBerror\fR' or `\fBtrap\fR' corresponding to each signal in
- X\fIsiglist\fR.
- X.sp
- XFor all signals except \fBSIGCLD\fR, the signal action will remain enabled
- Xafter the specified signal has occured. For \fBSIGCLD\fR (also known as
- X\fBSIGCHLD\fR), the signal will not be automatically reenable. A wait must be
- Xperformed before issuing another \fBsignal\fR command. Signals are not
- Xprocessed until after the completion of the Tcl command that is executing when
- Xthe signal is recieved.
- X'@endhelp
- X'@help: extended/sleep
- X'@brief: Sleep Tcl for the specified number of seconds.
- X.TP
- X.B sleep \fIseconds\fR
- X.br
- XSleep the TCL process for \fIseconds\fR.
- X'@endhelp
- X'@help: extended/system
- X'@brief: Execute command via `system' call.
- X.TP
- X.B system \fIcommand\fR
- X.br
- XExecutes \fIcommand\fR via the system(3) call. Differs from \fBexec\fR
- Xbecause \fBsystem\fR doesn't return stdout as the result or the command and
- X\fBsystem\fR goes through the shell to provide wildcard
- Xexpansion, redirection, etc,
- Xas is normal from a \fBsh\fR command line. Returns the exit code of
- Xthe command.
- X'@endhelp
- X'@help: extended/times
- X'@brief: Get process and child execution times.
- X.TP
- X.B times
- XReturn a list containing the process and child execution times in the form:
- X.br
- X \fIutime stime cutime cstime\fR
- X.br
- XSee times system call manual page. The values are in milliseconds.
- X'@endhelp
- X'@help: extended/umask
- X'@brief: Get or set the file-creation mode mask.
- X.TP
- X.B umask [\fIoctalmask\fR]
- X.br
- XSets file-creation mode mask to the octal value of \fIoctalmask\fR.
- XIf \fIoctalmask\fR is omitted, the current mask is returned.
- X'@endhelp
- X'@help: extended/unlink
- X'@brief: Delete (unlink) files.
- X.TP
- X.B unlink \fIfilelist\fR
- X.br
- XDelete (unlink) the files whose names are in the list \fIfilelist\fR.
- X'@endhelp
- X'@help: extended/wait
- X'@brief: Wait for a child process to terminate.
- X.TP
- X.B wait \fIproclist\fR
- X.br
- XWaits for an any of the immediate child processes specified in the list
- X\fIproclist\fR to terminate or a signal to be received. \fBWait\fR returns a
- Xlist of three elements: The first element is process id of the terminating
- Xprocess. If the process exited normally, the second element is `EXIT',
- Xfollowed by the error code. If the process terminated because of a signal,
- Xthe second element is `SIG', followed by the signal name. If the process is
- Xcurrently stopped, the second element is `STOP', followed by the signal name.
- X'@endhelp
- X'
- X.SH "FILE I/O COMMANDS"
- X.PP
- XThe commands extend the stdio-style file I/O capabilities present in Tcl 6.1.
- XThese extensions include searching ASCII-sorted data files, copying files,
- Xduplicating file descriptors, control of file access options, retrieving open
- Xfile status, and creating pipes with the \fBpipe\fR system call. A interface
- Xto the \fBselect\fR system call is also available on Unix systems that support
- Xit.
- X.PP
- XIt should be noted that Tcl file I/O is implemented on top of the stdio
- Xlibrary. By default, the file is buffered, when communicating to a process
- Xthrough a pipe, a \fBflush\fR command should be issued to force the data
- Xout. Alternatively, the \fBfcntl\fR command may be used to set the buffering
- Xmode to line buffered or unbuffered.
- X'@help: extended/bsearch
- X.TP
- X.B bsearch \fIfilehandle key\fR [\fIretvar\fR] [\fIcompare_proc\fR]
- X.br
- XSearch an opened sorted data file, \fIfilehandle\fR, for a line
- Xmatching \fIkey\fR. If \fIretvar\fR is specified, then the line from the
- Xfile is returned in \fIretvar\fR and the command returns \fB1\fR if \fIkey\fR
- Xwas found, and \fB0\fR if it was not found. If \fIretvar\fR is not specified
- Xor is a null name, then the command returns the line that was found, or an
- Xempty string if \fIkey\fR is not found.
- X.sp
- XBy default, the key is matched against the first white-space seperated field
- Xin each line. The field is treated as an ASCII string. If \fIcompare_proc\fR
- Xis specified, then it is the name of a Tcl procedure to evaluate against each
- Xline read from the file. This \fIcompare_proc\fR takes two arguments, the key
- Xand a line extracted from the file. The compare routine should return a
- Xnumber less than zero if the key is less than the line, zero if the key
- Xmatches the line or greater than zero if the key is greater than the line.
- XThe file must be sorted in assending order by whatever criteria
- X\fIcompare_proc\fR uses to compare the key with the line.
- X'@endhelp
- X'@help: extended/copyfile
- X'@brief: Copy remainder of one open file into another.
- X.TP
- X.B copyfile \fIhandle1 handle2\fR
- X.br
- XCopies the rest of file specified by \fIhandle1\fR from its current position
- Xto the file specified by \fIhandle2\fR.
- X'@endhelp
- X'@help: extended/dup
- X'@brief: Duplicate an open filehandle.
- X.TP
- X.B dup \fIfilehandle\fR [\fIstdhandle\fR]
- X.br
- XDuplicate an open file. A file handle is created that addresses the
- Xsame file as \fIfilehandle\fR.
- X.sp
- XA special case is allowed for dup-ing files to stdin, stdout or stderr.
- XIf \fIstdhandle\fR is specified, then it must be one of the
- Xstandard handles to dup \fIfilehandle\fR to.
- X.sp
- X.nf
- X.ftCW
- X proc ChildProcess {cmd inPipe outPipe} {
- X if {[set childPid [fork]] == 0} {
- X close stdin
- X dup $inPipe stdin
- X close $inPipe
- X
- X close stdout
- X dup $outPipe stdout
- X close $outPipe
- X
- X execvp $cmd
- X # will never make it here...
- X }
- X return $childPid
- X }
- X.ftR
- X.fi
- X'@endhelp
- X'@help: extended/fcntl
- X'@brief: Get or set open file access options.
- X.TP
- X.B fcntl \fIhandle\fR [\fIattribute value\fR]
- X.br
- XThis command either returns a list of various boolean attributes controlling
- Xaccess to a file or set or clears one of the boolean attributes. If
- X\fIattribute\fR and \fIvalue\fR are not specified, then the list of the
- Xattributes that are set are return. If an attribute is not set, then it will
- Xnot be included in the list. The following attributes maybe returned:
- X.IP
- X\fBRDONLY\fR - The file is opened for reading only.
- X.sp
- X\fBWRONLY\fR - The file is opened for writing only.
- X.sp
- X\fBRDWR\fR - The file is opened for reading and writing.
- X.sp
- X\fBAPPEND\fR - The file is opened for append only writes. All writes will
- Xbe forced to the end of the file.
- X.sp
- X\fBNDELAY\fR - The file is to be accessed with non-blocking I/O. See the
- X\fBread\fR system call for a description of how it affects the behaviour of
- Xfile reads
- X.sp
- X\fBCLEXEC\fR - Close the file on an process exec. If the \fBexecvp\fR
- Xcommand or some other mechanism causes the process to exec, the file will
- Xbe closed.
- X.sp
- X\fBNOBUF\fR - The file is not buffered. If set, then there no stdio buffering
- Xfor the file.
- X.sp
- X\fBLINEBUF\fR - Output the file will be line buffered. The buffer will
- Xbe flushed when a newline is written, when the buffer is full,
- Xor when input is requested.
- X.sp
- XThe \fBAPPEND\fR, \fBNDELAY\fR, and \fBCLEXEC\fR attributes may be set or
- Xcleared by specifying the attribute name and a value \fB1\fR to set the
- Xattribute and \fB0\fR to clear it.
- X.sp
- XThe \fBNOBUF\fR and \fBLINEBUF\fR attributes may only be set (a value of
- X\fB1\fR) and only one of the options may be set. Once set, they may not be
- Xcleared. Thees option should be set before any I/O operations have been done
- Xon the file.
- X'@endhelp
- X'
- X'@help: extended/fstat
- X'@brief: Obtain status information about a open file.
- X.TP
- X.B fstat \fIhandle\fR [\fIarrayvar\fR]
- X.br
- XObtain the status of an open file. This differs from the \fBfile stat\fR
- Xcommand in that it takes a file handle rather than a file name.
- XIf \fIarrayvar\fR is
- Xspecified, the status information is returned in the following elements of
- Xthis array variable: \fBatime\fR, \fBctime\fR, \fBdev\fR, \fBgid\fR,
- X\fBino\fR, \fBmode\fR, \fBmtime\fR, \fBnlink\fR, \fBsize\fR, \fBuid\fR.
- XEach element is a decimal string with the value of the corresponding
- Xfield from the \fBstat\fR return structure; see the manual entry
- Xfor \fBstat\fR for details on the meanings of the values. If \fIarrayvar\fR
- Xis not specified, then the information is returned as a keyed list. Each
- Xelement of the list is itself a list with the status value name paired with its
- Xvalue, in alphabetical order. For example:
- X.sp 1
- X.IP
- X{atime\ 683617279} {ctime\ 683617310} {dev\ 298} {gid\ 50} {ino\ 6317}
- X{mode\ 33152} {mtime\ 683617310} {nlink\ 1} {size\ 924} {uid\ 200}
- X'@endhelp
- X'
- X'@help: extended/pipe
- X'@brief: Create a pipe.
- X.TP
- X.B pipe [\fIhandle_var_r handle_var_w\fR]
- X.br
- XCreate a pipe (see the pipe system call manual page). If \fIhandle_var_r\fR
- Xand \fIhandle_var_r\fR are specified, then variable \fIhandle_var_r\fR will
- Xcontain the handle opened for reading and \fIhandle_var_w\fR will contain the
- Xhandle opened for writing. If the handle variables are not specified, then a
- Xlist containing the read followed by the write handle is returned as the
- Xresult of the command.
- X'@endhelp
- X'@help: extended/select
- X'@brief: Synchronous I/O multiplexing.
- X.TP
- X.B select \fIreadhandles\fR [\fIwritehandles\fR] [\fIexcepthandles\fR] [\fItimeout\fR]
- X.br
- XThis command allows polling or blocking on multiple files being ready for
- Xfor reading, are ready for writing, or have an exceptional condition pending.
- X\fIreadhandles\fR, \fIwritehandles\fR, \fIexcepthandles\fR are each lists
- Xof file handles (as returned from \fBopen\fR) to query. An empty list ({}) may
- Xbe specified if a category is not used.
- X.sp
- XThe \fIreadhandles\fR files are checked to set if data is available for
- Xreading. The \fIwritehandles\fR are checked if they are clear for writing The
- X\fIexcepthandles\fR are checked to see if an exceptional condition has
- Xoccured. The write and exception checking is most useful on devices, however,
- Xthe read checking is also very valuable when communicating with multiple
- Xprocesses through pipes.
- X.sp
- X\fITimeout\fR is a floating point timeout number of seconds. If an empty
- Xlist is supplied (or the parameter is omitted), then no timeout is set. If
- Xthe value is zero, then the \fBselect\fR command functions as a poll of the
- Xfiles.
- X.sp
- XIf the \fItimeout\fR period expires with none of the files becomming ready,
- Xthen the command returns an empty list. Otherwise the command returns a
- Xlist of three elements, each of those elements is a list of the file handles
- Xthat are ready in the read, write and exception classes. If none are ready in
- Xa class, then that element will be the null list. For example:
- X.nf
- X select {file3 file4 file5} {file6 file7} {} 10.5
- X
- Xcould return
- X {file3 file4} {file6} {}
- Xor perhaps
- X file3 {} {}
- X.fi
- X.sp
- X'@endhelp
- X'
- X.SH "FILE SCANNING COMMANDS"
- X.PP
- XThese commands provide a facility to scan files, matching lines of the file
- Xagainst regular expressions and executing Tcl code on a match. With this
- Xfacility you can use Tcl to do the sort of file processing
- Xthat are traditionally done with \fBawk\fR. And since Tcl's approach is more
- Xdeclarative, some of the scripts that are really hard to write in awk are a
- Xsnap in Tcl.
- X.PP
- XFile scanning in Tcl centers around the concept of a \fIscan context\fR.
- XA scan context contains one or more match statements, which associate
- Xregular expressions to scan for with Tcl code to be executed when the
- Xexpressions are matched.
- X'
- X'@help: extended/scancontext
- X'@brief: Manage file scan contexts.
- X.TP
- X.B scancontext [\fIoption\fR]
- X.br
- XThis command manages file scan contexts. A scan context is a collection of
- Xregular expressions and commands to execute when that regular expression
- Xmatches a line of the file. A context may also have a single default match,
- Xto be applied against lines that do not match any of the regular expressions.
- XMultiple scan contexts may be defined and the may be reused on multiple files.
- XA scan context is identified by a context handle. The \fBscancontext\fR
- Xcommand takes
- Xthe following forms:
- X.TP
- X.B scancontext create
- XCreate a new scan context. The \fBscanmatch\fR command is used to define
- Xpatterns in the context.
- X'
- X.TP
- X.B scancontext delete \fIcontexthandle\fR
- X.br
- XDelete the scan context identified by \fIcontexthandle\fR and free all the
- Xmatch statements and compiled regular expressions associated with the
- Xspecified context.
- X'@endhelp
- X'@help: extended/scanfile
- X'@brief: Scan a file, executing match code when their patterns are matched.
- X.TP
- X.B scanfile \fIcontexthandle\fR \fIfilehandle\fR
- X.br
- XScan the file specified by \fIfilehandle\fR, starting at the
- Xcurrent file position. Check all patterns in the scan context specified by
- X\fIcontexthandle\fR against
- Xit, executing the match commands corresponding to patterns matched.
- X'@endhelp
- X'@help: extended/scanmatch
- X'@brief: Specify tcl code to execute when scanfile pattern is matched.
- X.TP
- X.B scanmatch [\fB-nocase\fR] \fIcontexthandle\fR [\fIregexp\fR] \fIcommands\fR
- X.br
- XSpecify Tcl \fIcommands\fR, to be evaluated when \fIregexp\fR is matched by a
- X\fBscanfile\fR command. The match is added to the scan context specified by
- X\fIcontexthandle\fR. Several match statements may be
- Xspecified for a give context. \fIRegexp\fR is a regular expression (see the
- X\fBregexp\fR command). If \fB-nocase\fR is specified as the first argument,
- Xthe pattern is matched regardless of
- Xalphabetic case.
- X.sp
- XIf \fIregexp\fR is not specified, then a default match is
- Xspecified for the scan context. The default match will be executed when a
- Xline of the file does not match any of the specified regular expressions.
- X.sp
- XThe array, \fBmatchInfo\fR, is available when the Tcl code is executed and
- Xcontains information about the file being scanned. It is local to the top
- Xlevel of the match command unless declared global at that level. If it is to
- Xbe used as a global it \fImust\fR be declared global before \fBscanfile\fR is
- Xcalled (since \fBscanfile\fR sets the \fBmatchInfo\fR before the match code is
- Xexecuted, a subsequent \fBglobal\fR will override the local variable). The
- Xtext of the file line that was matched is in \fBmatchInfo(line)\fR. The byte
- Xoffset into the file of the line that was matched is in
- X\fBmatchInfo(offset)\fR. The line number of the line that was matched is in
- X\fBmatchInfo(linenum)\fR. This is relative to the first line scanned, not the
- Xfirst line of the file. The first line is line number one. The file handle
- Xof the file being scanned is in \fBmatchInfo(handle)\fR.
- X.PP
- XAll \fBscanmatch\fR patterns that match a line will be processed in the order
- Xthat the specifications were added to the scan context. The remainder of the
- X\fBscanmatch\fR pattern-command pairs may be skipped for a file line if a
- X\fBcontinue\fR is executed in the match command. If a \fBreturn\fR is
- Xexecuted in the body of the match command, the \fBscanfile\fR command in
- Xprogress returns with the value passed to \fBreturn\fR as it's value.
- X'@endhelp
- X'
- X.SH "MATH COMMANDS"
- X.PP
- XThese commands make many additonal math functions available in Tcl, including
- Xmin, max, trig functions, exponent, logarithm, square root, and more. An
- Xinteger random number generator is provided as well.
- X'@help: extended/acos
- X'@brief: Return the arccosine of a number.
- X.TP
- X.B acos \fInum\fR
- X.br
- XReturns the arccosine of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/asin
- X'@brief: Return the arcsin of a number.
- X.TP
- X.B asin \fInum\fR
- X.br
- XReturns the arcsin of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/atan
- X'@brief: Return the arctangent of a number..
- X.TP
- X.B atan \fInum\fR
- X.br
- XReturns the arctangent of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/ceil
- X'@brief: Return the smallest integer not less than a floating point number.
- X.TP
- X.B ceil \fInum\fR
- X.br
- XReturns the smallest integer not less than \fInum\fR (floating point).
- X'@endhelp
- X'@help: extended/cos
- X'@brief: Return the cosine of a number.
- X.TP
- X.B cos \fInum\fR
- X.br
- XReturns the cosine of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/cosh
- X'@brief: Return the hyperbolic cosine of a number.
- X.TP
- X.B cosh \fInum\fR
- X.br
- XReturns the hyperbolic cosine of \fInum\fR.
- X'@endhelp
- X'@help: extended/exp
- X'@brief: Return e to the power of a number.
- X.TP
- X.B exp \fInum\fR
- X.br
- XReturns \fIe\fR to the power of \fInum\fR.
- X'@endhelp
- X'@help: extended/fabs
- X'@brief: Return the absolute value of the floating point number.
- X.TP
- X.B fabs \fInum\fR
- X.br
- XReturns the absolute value of \fInum\fR (floating point).
- X'@endhelp
- X'@help: extended/floor
- X'@brief: Return the largest integer not greater than a floating point number.
- X.TP
- X.B floor \fInum\fR
- X.br
- XReturns the largest integer not greater than \fInum\fR (floating point).
- X'@endhelp
- X'@help: extended/fmod
- X'@brief: Perform a floating point modulus operation.
- X.TP
- X.B fmod \fInum1\fR \fInum2\fR
- X.br
- XReturns \fInum1\fR modulo \fInum2\fR.
- X'@endhelp
- X'@help: extended/max
- X'@brief: Return the argument that has the highest numeric value.
- X.TP
- X.B max \fInum1 num2\fR [..\fInumN\fR]
- X.br
- XReturns the argument that has the highest numeric value. The arguments,
- X\fInumN\fR may be any interger or floating point values.
- X'@endhelp
- X'@help: extended/min
- X'@brief: Return the argument that has the lowest numeric value.
- X.TP
- X.B min \fInum1 num2\fR [..\fInumN\fR]
- X.br
- XReturns the argument that has the lowest numeric value. The arguments,
- X\fInumN\fR may be any interger or floating point values.
- X'@endhelp
- X'@help: extended/log
- X'@brief: Return the natural logarithm of a number.
- X.TP
- X.B log \fInum\fR
- X.br
- XReturns the natural logarithm of \fInum\fR.
- X'@endhelp
- X'@help: extended/log10
- X'@brief: Return the logarithm base 10 of a number.
- X.TP
- X.B log10 \fInum\fR
- X.br
- XReturns the logarithm base 10 of \fInum\fR.
- X'@endhelp
- X'@help: extended/pow
- X'@brief: Return a number to the power of another number.
- X.TP
- X.B pow \fInum1\fR \fInum2\fR
- X.br
- XReturns \fInum1\fR to the power of \fInum2\fR.
- X'@endhelp
- X'@help: extended/random
- X'@brief: Return a pseudorandom integer or set the seed.
- X.TP
- X.B random \fBlimit\fR | \fBseed\fR [\fIseedval\fR]
- X.br
- XGenerate a pseudorandom integer number greater than or equal to zero and
- Xless than \fIlimit\fR. If \fBseed\fR is specified, then the command
- Xresets the random number generator to a starting point derived from
- Xthe \fBseedval\fR. This allows one to reproduce a random number sequence
- Xfor testing purposes.
- XIf \fIseedval\fR is omitted, then the seed is set to a value based on current
- Xsystem state and the current time, providing a reasonably interesting and
- Xever-changing seed.
- X'@endhelp
- X'@help: extended/sin
- X'@brief: Return the sin of a number.
- X.TP
- X.B sin \fInum\fR
- X.br
- XReturns the sin of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/tan
- X'@brief: Return the tangent of a number.
- X.TP
- X.B tan \fInum\fR
- X.br
- XReturns the tangent of \fInum\fR. \fInum\fR is in radians.
- X'@endhelp
- X'@help: extended/sinh
- X'@brief: Return the hyperbolic sin of a number.
- X.TP
- X.B sinh \fInum\fR
- X.br
- XReturns the hyperbolic sin of \fInum\fR.
- X'@endhelp
- X'@help: extended/sqrt
- X'@brief: Return the square root of a number.
- X.TP
- X.B sqrt \fInum\fR
- X.br
- XReturns the square root of \fInum\fR.
- X'@endhelp
- X'@help: extended/tanh
- X'@brief: Return the hyperbolic tangent of a number.
- X.TP
- X.B tanh \fInum\fR
- X.br
- XReturns the hyperbolic tangent of \fInum\fR.
- X'@endhelp
- X'
- X.SH "LIST MANINIPULATION COMMANDS"
- X.PP
- XExtended Tcl provides two additional list manipulation commands.
- X'@help: extended/lempty
- X'@brief: Determine if a list is empty.
- X.TP
- X.B lempty \fIlist\fR
- X.br
- XDetermine if the specified list is empty.
- XIf empty, 1 is returned, otherwise, 0 is returned. This command is an
- Xalternative to comparing a list to an empty string.
- X'@endhelp
- X'
- X'@help: extended/lvarpop
- X'@brief: Pop or replace the specified element from a list.
- X.TP
- X.B lvarpop \fIvar\fR [\fIindex\fR \fR[\fIstring\fR]]
- X.br
- XThe \fBlvarpop\fR command pops (deletes) the element indexed by
- X\fIindex\fR from the list in the variable \fIvar\fR.
- XIf \fIindex\fR is omitted, then 0 is assumed.
- XIf \fIstring\fR, is specified, then the deleted element is replaced by
- X\fIstring\fR. The replaced or deleted element is returned.
- XThus ``lvarpop argv 0'' returns the first element and sets argv to contain the
- Xremainder of the string.
- X'@endhelp
- X'
- X'@help: extended/keyedlists
- X'@brief: Introduction to keyed lists
- X.SH "KEYED LISTS"
- X.PP
- XExtended Tcl defines a special type of list referred to as \fIkeyed lists\fR.
- XThese lists provided a structured data type built upon standard Tcl lists.
- XThis provides a functionality similar to \fBstruct\fRs in the C
- Xprogramming language.
- XA keyed list is a list in which each element is a key and value pair field.
- XThese elements are actually lists themselves, were the key is the first
- Xelement of the list, and the value is the second. The key-value pairs are
- Xrefered to as \fIfields\fR.
- XThis is an example of a keyed list:
- X.IP
- X {{NAME {Frank Zappa}} {JOB {musician and composer}}
- X'
- X.PP
- XBy convention, `.' is a field name separator, allowing nesting of fields,
- Xeven though keyed list are only one level deep. Currently none of the commands
- Xexplictly function on nested field names, but they may in a future release,
- Xso `.' should not be used for other than a field separator in a name. For
- Xexample:
- X.IP
- X {{ID 106} {NAME.FIRST Frank} {NAME.LAST Zappa}}
- X.PP
- XAll key list functions take the name of the variable containing the keyed list
- Xas an argument (i.e. passed by reference) rather than the value.
- X'@endhelp
- X'@help: extended/keyldel
- X'@brief: Delete a field of a keyed list.
- X.TP
- X.B keyldel \fIlistvar\fR \fIkey\fR
- X.br
- XDelete the field specified by \fIkey\fR from the keyed list in the
- Xvariable \fIlistvar\fR. This removes both the key and the value from
- Xthe keyed list.
- X'@endhelp
- X'@help: extended/keylget
- X'@brief: Get the value of a field of a keyed list.
- X.TP
- X.B keylget \fIlistvar\fR \fIkey\fR [\fIretvar\fR | {}]
- X.br
- XReturn the value associated with the \fIkey\fR out of keyed list in the
- Xvariable \fIlistvar\fR. If \fIretvar\fR is not specified, then the value will
- Xbe returned as the result of the command. If \fIkey\fR is not found in the
- Xlist, an error will result. If \fIretvar\fR is specified and \fIkey\fR is in
- Xthe list, then the value is returned in the variable \fIretvar\fR and the
- Xcommand returns one.
- XIf \fIkey\fR is not in the list, the command will return \fB0\fR
- Xand \fIretvar\fR will be unchanged. If \fB{}\fR is specified for
- X\fIretvar\fR, the value is not returned, only the presence of the key is
- Xdetermined.
- X'@endhelp
- X'
- X'@help: extended/keylset
- X'@brief: Set the value of a field of a keyed list.
- X.TP
- X.B keylset \fIlistvar\fR \fIkey\fR \fIvalue\fR
- X.br
- XSet the value associated with the \fIkey\fR in the keyed list in the
- Xvariable \fIlistvar\fR to \fIvalue\fR.
- XIf \fRlistvar\fR does not exists, it is created. If \fIkey\fR
- Xis not currently in the list, it will be added. If it already exists,
- X\fIvalue\fR overrides the existing value.
- X'@endhelp
- X'
- X.SH "STRING AND CHARACTER MANIPULATION COMMANDS"
- X.PP
- XThe commands provide additional functionality to classify characters, convert
- Xcharacters between character and numeric values, and index into a string,
- Xdetermine the length of a string, extract a range of character from a string,
- Xreplicate a string a number of times, and transliterate a string (similar to
- Xthe \fItr\fR command).
- X'
- X'@help: extended/cindex
- X'@brief: Return indexed character from string.
- X.TP
- X.B cindex \fIstring index\fR
- X.br
- XReturns the character indexed by \fIindex\fR (zero based) from \fIstring\fR.
- XThis command is a shortcut for:
- X.nf
- X.ft CW
- X \fBstring index\fR \fIstring index\fR
- X.ft R
- X.fi
- X'@endhelp
- X'@help: extended/clength
- X'@brief: Return length of specified string.
- X.TP
- X.B clength \fIstring\fR
- X.br
- XReturns the length of \fIstring\fR in characters.
- XThis command is a shortcut for:
- X.nf
- X.ft CW
- X \fBstring length\fR \fIstring\fR
- X.ft R
- X.fi
- X'@endhelp
- X'@help: extended/crange
- X'@brief: Return range of characters from string.
- X.TP
- X.B crange \fIstring first last\fR
- X.br
- XReturns a range of characters from \fIstring\fR starting at \fIfirst\fR
- X(zero-based) until \fIlast\fR. The special keyword \fBend\fR may be specified
- Xfor \fIlast\fR to indicate that the remainder of the string is to be
- Xextracted. This command is a short cut for:
- X.nf
- X.ft CW
- X \fBstring range\fR \fIstring first last\fR
- X.ft R
- X.fi
- X'@endhelp
- X'@help: extended/csubstr
- X'@brief: Return a substring from within a string.
- X.TP
- X.B csubstr \fIstring first length\fR
- X.br
- XReturns a range of characters from \fIstring\fR starting at \fIfirst\fR
- X(zero-based) for \fIlength\fR characters.
- XThe special keyword \fBend\fR may be specified
- Xfor \fIlength\fR to indicate that the remainder of the string is to be
- Xextracted. This command is a short cut for:
- X.nf
- X.ft CW
- X \fBstring range\fR \fIstring first\fR [\fBexpr\fR \fIlength\fB-1\fR]
- X.ft R
- X.fi
- X'@endhelp
- X'@help: extended/ctype
- X'@brief: Determine if string has various characteristics.
- X.TP
- X.B ctype \fIclass string\fR
- X.br
- XDetermine if all characters in \fIstring\fR are in of the specified
- X\fIclass\fR. Returns \fB1\fR if they are all of \fIclass\fR and \fB0\fR if
- Xthey are not or if the string is null. This command also provides another
- Xmethod (besides \fBformat\fR and \fBscan\fR) of converting between an ASCII
- Xcharacter and its numeric value. The following \fBctype\fR commands are
- Xavailable.
- X.RS 5
- X.TP
- X.B ctype alnum \fIstring\fR
- XTests that all characters are alphabetic or numeric characters as defined by
- Xthe character set.
- X.TP
- X.B ctype alpha \fIstring\fR
- XTests that all characters are alphabetic characters as defined by the
- Xcharacter set.
- X.TP
- X.B ctype ascii \fIstring\fR
- XTests that all characters are an ASCII character (a non-negative number less
- Xthan 0200).
- X.TP
- X.B ctype char \fInumber\fR
- XConverts the numeric value, \fIstring\fR, to an ASCII character. Number must
- Xbe in the range 0 through 255.
- X.TP
- X.B ctype cntrl \fIstring\fR
- XTests that all characters are ``control characters'' as defined by the
- Xcharacter set.
- X.TP
- X.B ctype digit \fIstring\fR
- XTests that all characters are valid decimal digits, i.e. 0 through 9.
- X.TP
- X.B ctype graph \fIstring\fR
- XTests that all characters within are any character for which \fIctype print\fR
- Xis true, except for space characters.
- X.TP
- X.B ctype lower \fIstring\fR
- XTests that all characters are lowercase letters as defined by the character
- Xset.
- X.TP
- X.B ctype ord \fIcharacter\fR
- XConvert a character into its decimal numeric value. The string must be one
- Xcharacter long.
- X.TP
- X.B ctype space \fIstring\fR
- XTests that all characters are either a space, horizontal-tab, carriage
- Xreturn, newline, vertical-tab, or form-feed.
- X.TP
- X.B ctype print \fIstring\fR
- XTests that all characters are a space or any character for which \fIctype
- Xalnum\fR or \fIctype punct\fR is true or other ``printing character'' as
- Xdefined by the character set.
- X.TP
- X.B ctype punct \fIstring\fR
- XTests that all characters are made up of any of the characters
- Xother than the ones for which
- X\fBalnum\fR, \fBcntrl\fR, or \fBspace\fR is true.
- X.TP
- X.B ctype upper \fIstring\fR
- XTests that all characters are uppercase letters as defined by the character
- Xset.
- X.TP
- X.B ctype xdigit \fIstring\fR
- XTests that all characters are valid hexadecimal digits, that is \fI0\fR
- Xthrough \fI9\fR, a through \fIf\fR or \fIA\fR through \fIF\fR.
- X.RE
- X'@endhelp
- X'@help: extended/replicate
- X'@brief: Replicate string a number of times.
- X.TP
- X.B replicate \fIstring count\fR
- X.br
- XReturns \fIstring\fR replicated \fIcount\fR times.
- X'@endhelp
- X'@help: extended/translit
- X'@brief: Translate characters in string according to patterns.
- X.TP
- X.B \fBtranslit \fIinrange outrange string\fR
- X.br
- XTranslate characters in \fIstring\fR matching characters in \fIinrange\fR
- Xto the corresponding character in \fIoutrange\fR. \fIInrange\fR and
- X\fIoutrange\fR may be list of characters or a range in the form `A-M'.
- X.nf
- X.ft CW
- X Example:
- X translit a-z A-Z foobar
- X returns
- X FOOBAR
- X.ft R
- X.if
- X'@endhelp
- END_OF_FILE
- if test 42986 -ne `wc -c <'extended/man/TclX.man'`; then
- echo shar: \"'extended/man/TclX.man'\" unpacked with wrong size!
- fi
- # end of 'extended/man/TclX.man'
- fi
- echo shar: End of archive 23 \(of 23\).
- cp /dev/null ark23isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 23 archives.
- echo "Now cd to "extended", edit the makefile, then do a "make""
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-