Rev | Line | |
---|
[25] | 1 | '\" |
---|
| 2 | '\" Copyright (c) 1993 The Regents of the University of California. |
---|
| 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
---|
| 4 | '\" |
---|
| 5 | '\" See the file "license.terms" for information on usage and redistribution |
---|
| 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
| 7 | '\" |
---|
| 8 | '\" RCS: @(#) $Id: pwd.n,v 1.7 2007/02/18 18:42:55 dkf Exp $ |
---|
| 9 | '\" |
---|
| 10 | .so man.macros |
---|
| 11 | .TH pwd n "" Tcl "Tcl Built-In Commands" |
---|
| 12 | .BS |
---|
| 13 | '\" Note: do not modify the .SH NAME line immediately below! |
---|
| 14 | .SH NAME |
---|
| 15 | pwd \- Return the absolute path of the current working directory |
---|
| 16 | .SH SYNOPSIS |
---|
| 17 | \fBpwd\fR |
---|
| 18 | .BE |
---|
| 19 | |
---|
| 20 | .SH DESCRIPTION |
---|
| 21 | .PP |
---|
| 22 | Returns the absolute path name of the current working directory. |
---|
| 23 | .SH EXAMPLE |
---|
| 24 | Sometimes it is useful to change to a known directory when running |
---|
| 25 | some external command using \fBexec\fR, but it is important to keep |
---|
| 26 | the application usually running in the directory that it was started |
---|
| 27 | in (unless the user specifies otherwise) since that minimizes user |
---|
| 28 | confusion. The way to do this is to save the current directory while |
---|
| 29 | the external command is being run: |
---|
| 30 | .CS |
---|
| 31 | set tarFile [file normalize somefile.tar] |
---|
| 32 | set savedDir [\fBpwd\fR] |
---|
| 33 | cd /tmp |
---|
| 34 | exec tar -xf $tarFile |
---|
| 35 | cd $savedDir |
---|
| 36 | .CE |
---|
| 37 | .SH "SEE ALSO" |
---|
| 38 | file(n), cd(n), glob(n), filename(n) |
---|
| 39 | |
---|
| 40 | .SH KEYWORDS |
---|
| 41 | working directory |
---|
Note: See
TracBrowser
for help on using the repository browser.