summaryrefslogtreecommitdiffstats
path: root/doc/subst.n
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1998-03-26 14:45:59 (GMT)
committerrjohnson <rjohnson>1998-03-26 14:45:59 (GMT)
commit2b5738da524e944cda39e24c0a87b745a43bd8c3 (patch)
tree6e8c9473978f6dab66c601e911721a7bd9d70b1b /doc/subst.n
parentc6a259aeeca4814a97cf6694814c63e74e4e18fa (diff)
downloadtcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.zip
tcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.tar.gz
tcl-2b5738da524e944cda39e24c0a87b745a43bd8c3.tar.bz2
Initial revision
Diffstat (limited to 'doc/subst.n')
-rw-r--r--doc/subst.n48
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/subst.n b/doc/subst.n
new file mode 100644
index 0000000..7a19b91
--- /dev/null
+++ b/doc/subst.n
@@ -0,0 +1,48 @@
+'\"
+'\" Copyright (c) 1994 The Regents of the University of California.
+'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" SCCS: @(#) subst.n 1.9 96/03/25 20:24:17
+'\"
+.so man.macros
+.TH subst n 7.4 Tcl "Tcl Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+subst \- Perform backslash, command, and variable substitutions
+.SH SYNOPSIS
+\fBsubst \fR?\fB\-nobackslashes\fR? ?\fB\-nocommands\fR? ?\fB\-novariables\fR? \fIstring\fR
+.BE
+
+.SH DESCRIPTION
+.PP
+This command performs variable substitutions, command substitutions,
+and backslash substitutions on its \fIstring\fR argument and
+returns the fully-substituted result.
+The substitutions are performed in exactly the same way as for
+Tcl commands.
+As a result, the \fIstring\fR argument is actually substituted twice,
+once by the Tcl parser in the usual fashion for Tcl commands, and
+again by the \fIsubst\fR command.
+.PP
+If any of the \fB\-nobackslashes\fR, \fB\-nocommands\fR, or
+\fB\-novariables\fR are specified, then the corresponding substitutions
+are not performed.
+For example, if \fB\-nocommands\fR is specified, no command substitution
+is performed: open and close brackets are treated as ordinary characters
+with no special interpretation.
+.PP
+Note: when it performs its substitutions, \fIsubst\fR does not
+give any special treatment to double quotes or curly braces. For
+example, the script
+.CS
+\fBset a 44
+subst {xyz {$a}}\fR
+.CE
+returns ``\fBxyz {44}\fR'', not ``\fBxyz {$a}\fR''.
+
+.SH KEYWORDS
+backslash substitution, command substitution, variable substitution