| 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 |
.TH pwd n "" Tcl "Tcl Built-In Commands" |
| 9 |
.so man.macros |
| 10 |
.BS |
| 11 |
'\" Note: do not modify the .SH NAME line immediately below! |
| 12 |
.SH NAME |
| 13 |
pwd \- Return the absolute path of the current working directory |
| 14 |
.SH SYNOPSIS |
| 15 |
\fBpwd\fR |
| 16 |
.BE |
| 17 |
.SH DESCRIPTION |
| 18 |
.PP |
| 19 |
Returns the absolute path name of the current working directory. |
| 20 |
.SH EXAMPLE |
| 21 |
.PP |
| 22 |
Sometimes it is useful to change to a known directory when running |
| 23 |
some external command using \fBexec\fR, but it is important to keep |
| 24 |
the application usually running in the directory that it was started |
| 25 |
in (unless the user specifies otherwise) since that minimizes user |
| 26 |
confusion. The way to do this is to save the current directory while |
| 27 |
the external command is being run: |
| 28 |
.PP |
| 29 |
.CS |
| 30 |
set tarFile [file normalize somefile.tar] |
| 31 |
set savedDir [\fBpwd\fR] |
| 32 |
cd /tmp |
| 33 |
exec tar -xf $tarFile |
| 34 |
cd $savedDir |
| 35 |
.CE |
| 36 |
.SH "SEE ALSO" |
| 37 |
file(n), cd(n), glob(n), filename(n) |
| 38 |
.SH KEYWORDS |
| 39 |
working directory |